Automatic marking method and device for port transportation data
The pre-trained UIE model is used to extract entities and automatically label port transportation data, which solves the problems of slow manual labeling, high cost and difficulty in ensuring accuracy, realizes automatic labeling and visual display, and improves labeling efficiency and accuracy. .
Patent Information
- Application Number
- CN202410916005.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-09-27
AI Technical Summary
In the existing technology, data annotation of port transportation information mainly relies on manual labor, which is slow, costly and difficult to guarantee accuracy.
Use the pre-trained UIE model to extract entities from the port transportation data through the target interface, and implement automated annotation and visual display based on the entity extraction results on the data annotation platform. Establish a mapping relationship between the labels and the UIE model predefined Schema. The target interface connects the UIE model and the data annotation platform, and performs format conversion to adapt to the format supported by the data annotation platform.
It realizes the automatic annotation of port transportation data, improves the annotation speed and accuracy, reduces the cost, can easily observe and modify the annotation results when the amount of data is large, and supports batch processing and frequency downloading.
Smart Images

Figure CN118708640A
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data labeling technology, and more specifically, relates to a method and device for automatically labeling port transportation data. Background Art
[0002] As a traditional transportation operation, port transportation is in the process of transformation from traditional management to digital management. The long-term paper data recording port transportation information is an important support for digital management. Quickly screening out valuable information from a large amount of port transportation information is of great significance for subsequent data analysis. At present, in the process of extracting and screening port transportation information, data annotation mostly adopts manual annotation, which has the disadvantages of slow speed, high cost, and difficult to guarantee accuracy. Therefore, how to automatically annotate these port transportation information is an urgent problem to be solved. Summary of the invention
[0003] In view of the defects existing in the related technologies, the embodiments of the present application provide a method and device for automatic labeling of port transportation data, aiming to solve the problems of slow speed, high cost and difficulty in ensuring accuracy of manual labeling.
[0004] In a first aspect, an embodiment of the present application provides a method for automatically labeling port transportation data, comprising:
[0005] Obtain port transportation data to be annotated;
[0006] The pre-trained UIE model is called through the target interface to extract entities from the port transportation data to be labeled, and the entity extraction results in a unified format obtained by the UIE model are received through the target interface; wherein the target interface is used to connect the data labeling platform with the UIE model, and the entity extraction results include entities and entity types in the port transportation data to be labeled;
[0007] On the data labeling platform, the port transport data to be labeled is automatically labeled and visualized based on the entity extraction results.
[0008] In some embodiments, the method further comprises:
[0009] Establish the labels that need to be identified on the data annotation platform, and establish the mapping relationship between each label and the predefined Schema of the UIE model.
[0010] In some embodiments, the method further comprises:
[0011] Connect the pre-trained UIE model to the data annotation platform through the target interface.
[0012] In some embodiments, receiving entity extraction results in a unified format obtained by the UIE model includes:
[0013] The entity extraction results in a unified format obtained by the UIE model after format conversion are received. The format conversion is used to convert the entity extraction results in a unified format obtained by the UIE model into a format supported by the data annotation platform.
[0014] In a second aspect, the embodiment of the present application further provides an automatic labeling device for port transportation data, comprising:
[0015] An acquisition module is used to acquire the port transportation data to be marked;
[0016] The entity extraction module is used to call the pre-trained UIE model through the target interface to extract entities from the port transportation data to be labeled, and receive the entity extraction results in a unified format obtained by the UIE model through the target interface; wherein the target interface is used to connect the data labeling platform with the UIE model, and the entity extraction results include entities and entity types in the port transportation data to be labeled;
[0017] The labeling module is used to complete the automatic labeling and visual display of the port transportation data to be labeled based on the entity extraction results on the data labeling platform.
[0018] In some embodiments, the apparatus further comprises:
[0019] The mapping module is used to establish the labels that need to be identified on the data annotation platform and to establish the mapping relationship between each label and the predefined Schema of the UIE model.
[0020] In some embodiments, the apparatus further comprises:
[0021] The connection module is used to connect the pre-trained UIE model and the data annotation platform through the target interface.
[0022] In some embodiments, the entity extraction module is specifically used to:
[0023] The entity extraction results in a unified format obtained by the UIE model after format conversion are received. The format conversion is used to convert the entity extraction results in a unified format obtained by the UIE model into a format supported by the data annotation platform.
[0024] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect.
[0025] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.
[0026] In a fifth aspect, an embodiment of the present application further provides a computer program product, which, when executed on a processor, enables the processor to execute the method described in the first aspect or any possible implementation of the first aspect.
[0027] The automatic labeling method and device for port transportation data provided in the embodiment of the present application realize entity extraction of port transportation data through the UIE model, and at the same time connect the data labeling platform and the trained UIE model through the target interface, so that the pre-trained UIE model can be used on the data labeling platform to realize automatic labeling and visual display of port transportation data. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions in the present application or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0029] Figure 1 It is a flowchart of the method for automatically labeling port transportation data provided by an embodiment of the present application;
[0030] Figure 2 is a schematic diagram of the structure of an automatic labeling device for port transportation data provided by an embodiment of the present application;
[0031] Figure 3 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0033] Figure 1 FIG. 1 is a flow chart of the method for automatically labeling port transportation data provided in an embodiment of the present application. Figure 1 As shown, the execution subject of the method is a data annotation platform, and the method includes at least the following steps:
[0034] S101. Obtain port transportation data to be marked.
[0035] S102, calling the UIE model through the target interface to extract entities from the port transportation data to be annotated, and receiving the entity extraction results in a unified format obtained by the UIE model through the target interface.
[0036] Specifically, the target interface is used to connect the data annotation platform with the pre-trained entity extraction model, so that the system can call the entity extraction model connected to the data annotation platform through the target interface to perform entity extraction on the input data. Optionally, the entity extraction model adopts the Universal Information Extraction (UIE) model, and UIE can realize information extraction of small sample data. The core of UIE is to construct a unified output style for different tasks (entity recognition). The input and output of UIE are different from traditional information extraction tasks. Its input is Structural Schema Instructor (SSI) and text, and its output is Structural Extraction Language (SEL).
[0037] The structured extraction language is equivalent to defining a new type of structured language, which can clearly express both entities and relationships, and unifies the output format of UIE. The structured pattern director is a pattern-based prompt mechanism used to control the content that UIE needs to discover, associate and generate, including three marker segments: ①SPOTNAME: the target spotting name in the input information extraction task, such as the entity in entity extraction; ②ASSONAME: the name of the relationship between entities, such as working for someone in relationship extraction; ③prompt: when inputting, the pre-defined Schem a is used as a prompt information and added to the front of the input text for input.
[0038] When the labeling work begins, the UIE model connected to the data labeling platform is called through the target interface to extract entities from the port transportation data to be labeled, and the entity extraction results are returned to the data labeling platform through the target interface. The input of the UIE model is the port transportation data to be labeled and the structured pattern director, and the output is the entity extraction results in a unified format. The entity extraction results specifically include the entities and entity types in the port transportation data to be labeled.
[0039] S103. On the data labeling platform, the automatic labeling and visual display of the port transportation data to be labeled are completed based on the entity extraction results.
[0040] Specifically, based on the entity extraction results obtained by the UIE model, the input port transportation data is automatically labeled and visualized on the data labeling platform through the inherent functions of the data labeling platform.
[0041] The entity extraction results output by the UIE model are dictionary-type data. It is difficult to directly observe the annotation results, especially when the amount of data is large. At the same time, the entity extraction results output by the UIE model are not 100% accurate. The annotated data may be modified automatically or manually later, such as adding unannotated results that are automatically annotated, and deleting incorrect results that are automatically annotated.
[0042] Therefore, it is necessary to visualize the entity extraction results output by the UIE model on the data annotation platform, which can not only directly observe the annotation effect, but also facilitate the subsequent entity addition, modification, deletion and other operations, as well as the analysis of entity distribution. Optionally, after visual annotation on the data annotation platform, the annotation results can be further modified according to the distribution of various entities, and some data can be manually adjusted.
[0043] The automatic labeling method for port transportation data provided in the embodiment of the present application realizes entity extraction of port transportation data through the UIE model, and at the same time uses the target interface to connect the data labeling platform and the trained UIE model, so that the pre-trained UIE model can be used on the data labeling platform to realize automatic labeling and visual display of port transportation data.
[0044] In some embodiments, the method for automatically labeling port transportation data further includes:
[0045] Establish the labels that need to be identified on the data annotation platform, and establish the mapping relationship between each label and the predefined Schema of the UIE model.
[0046] Specifically, the basic implementation logic of the visual annotation of port transportation data is as follows: first, connect the trained UIE model to the data annotation platform through the interface; second, establish the labels that need to be identified on the data annotation platform, and set the mapping relationship between each label and the predefined Schema of the UIE model; then, use the interface to automatically transfer the port transportation data input on the data annotation platform to the trained UIE model on the back end for entity extraction, and transmit the entity extraction results back to the data annotation platform through the interface; realize automatic annotation and visual display on the data annotation platform.
[0047] On the data annotation platform, you can create labels that need to be identified, such as "special data", "small sample", "typical case" and other labels. Finally, the labeling results on the data annotation platform will also be based on these labels. Optionally, you can also select different colors to control the labeling results when creating labels.
[0048] When setting up automatic annotation, the corresponding mapping must be established to ensure the annotation effect. The entity extraction results obtained by the UIE model need to be correctly identified and displayed by the data annotation platform. Therefore, after establishing the labels that need to be identified on the data annotation platform, it is necessary to establish a mapping relationship between each label and the predefined Schema of the UIE model, so that the entity type identified by calling the UIE model through the interface is mapped to the label of the data annotation platform.
[0049] In some embodiments, the method for automatically labeling port transportation data further includes:
[0050] Connect the pre-trained UIE model to the data annotation platform through the target interface.
[0051] Specifically, a target interface is written to connect the trained entity extraction model and the data annotation platform, so that the system can call the entity extraction model connected to the data annotation platform through the target interface to extract entities from the input data. Optionally, the target interface is named entity recognition interface.
[0052] The automatic labeling method for port transportation data provided in the embodiment of the present application supports batch processing of port transportation data (including batch uploading and frequent downloading). After the port transportation data is input into the data labeling platform, multiple port transportation data can be labeled simultaneously; after the connection between the data labeling platform and the UIE model is established, the connection can still be used when logging in next time after exiting the data labeling platform without redefining the connection or mapping.
[0053] In some embodiments, receiving the entity extraction result in a unified format obtained by the UIE model in S102 specifically includes:
[0054] The entity extraction results in a unified format obtained by the UIE model after format conversion are received. The format conversion is used to convert the entity extraction results in a unified format obtained by the UIE model into a format supported by the data annotation platform.
[0055] Specifically, the main purpose of the UIE model is to realize entity extraction, and data labeling requires further processing of the entity extraction results output by the UIE model.
[0056] The output of the UIE model is an entity extraction result in a unified format, but this format is not necessarily supported by the data annotation platform. Therefore, in order to ensure the annotation effect of the port transportation data, the entity extraction results output by the UIE model need to be converted into a format supported by the data annotation platform and returned to the data annotation platform, such as json format or jsonl format. When the port transportation data is automatically annotated, the downloaded data is in the annotated json format or jsonl format. Through the statistical results of data annotation, the proportion of various entities in the input port transportation data can be quickly determined for further processing.
[0057] Based on this, the complete automatic annotation process of port transportation data is as follows: the trained UIE model is connected to the data annotation platform through an interface, and then the port transportation data input on the data annotation platform can be automatically input to the UIE model in the background through the interface. The entity extraction results obtained after processing by the UIE model are parsed and converted into a format that can be recognized by the data annotation platform, and then returned to the data annotation platform through the interface. The labels corresponding to each schema in the model are established in advance on the data annotation platform, and the connection between each label and the schema is established through a mapping function. Then, through the inherent functions of the data annotation platform, each input data is visually annotated.
[0058] Figure 2 is a schematic diagram of the structure of the automatic labeling device for port transportation data provided by the embodiment of the present application, such as Figure 2 As shown, the device at least includes:
[0059] An acquisition module 201 is used to acquire the port transportation data to be marked;
[0060] The entity extraction module 202 is used to call the pre-trained UIE model through the target interface to extract entities from the port transportation data to be labeled, and receive the entity extraction results in a unified format obtained by the UIE model through the target interface; wherein the target interface is used to connect the data labeling platform and the UIE model, and the entity extraction results include entities and entity types in the port transportation data to be labeled;
[0061] The labeling module 203 is used to complete the automatic labeling and visual display of the port transportation data to be labeled based on the entity extraction results on the data labeling platform.
[0062] In some embodiments, the apparatus further comprises:
[0063] The mapping module is used to establish the labels that need to be identified on the data annotation platform and to establish the mapping relationship between each label and the predefined Schema of the UIE model.
[0064] In some embodiments, the apparatus further comprises:
[0065] The connection module is used to connect the pre-trained UIE model and the data annotation platform through the target interface.
[0066] In some embodiments, the entity extraction module 202 is specifically used to:
[0067] The entity extraction results in a unified format obtained by the UIE model after format conversion are received. The format conversion is used to convert the entity extraction results in a unified format obtained by the UIE model into a format supported by the data annotation platform.
[0068] It can be understood that the detailed functional implementation of each of the above-mentioned units / modules can be found in the introduction of the aforementioned method embodiment, and will not be repeated here.
[0069] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method, which will not be repeated here.
[0070] Based on the method in the above embodiment, an embodiment of the present application provides an electronic device. The device may include: at least one memory for storing programs and at least one processor for executing the programs stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method described in the above embodiment.
[0071] Figure 3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 3 As shown, the electronic device may include: a processor 301, a communications interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communications interface 302 and the memory 303 communicate with each other via the communication bus 304. The processor 301 may call the software instructions in the memory 303 to execute the method described in the above embodiment.
[0072] In addition, the logic instructions in the above-mentioned memory 303 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0073] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.
[0074] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.
[0075] It is understandable that the processor in the embodiment of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0076] The method steps in the embodiments of the present application can be implemented by hardware, or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (Random Access Memory, RAM), flash memory, read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0077] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center to another website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.
[0078] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
[0079] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for automatically labeling port transportation data, characterized in that: include: Obtain port transportation data to be annotated; Calling a pre-trained UIE model through a target interface to extract entities from the port transportation data to be labeled, and receiving entity extraction results in a unified format obtained by the UIE model through the target interface; wherein the target interface is used to connect the data labeling platform with the UIE model, and the entity extraction results include entities and entity types in the port transportation data to be labeled; On the data labeling platform, the automatic labeling and visual display of the port transportation data to be labeled are completed based on the entity extraction results.
2. The automatic labeling method for port transportation data according to claim 1 is characterized in that: The method further comprises: The labels that need to be identified are established on the data annotation platform, and a mapping relationship between each label and the predefined Schema of the UIE model is established.
3. The automatic labeling method for port transportation data according to claim 1 is characterized in that: The method further comprises: The pre-trained UIE model is connected to the data annotation platform through the target interface.
4. The automatic labeling method for port transportation data according to claim 1 is characterized in that: The receiving the entity extraction result in a unified format obtained by the UIE model includes: Receive the entity extraction results in a unified format obtained by the UIE model after format conversion, wherein the format conversion is used to convert the entity extraction results in a unified format obtained by the UIE model into a format supported by the data annotation platform.
5. An automatic labeling device for port transportation data, characterized in that: include: An acquisition module is used to acquire the port transportation data to be marked; An entity extraction module is used to call a pre-trained UIE model through a target interface to perform entity extraction on the port transportation data to be labeled, and receive entity extraction results in a unified format obtained by the UIE model through the target interface; wherein the target interface is used to connect the data labeling platform with the UIE model, and the entity extraction results include entities and entity types in the port transportation data to be labeled; The labeling module is used to complete the automatic labeling and visual display of the port transportation data to be labeled based on the entity extraction result on the data labeling platform.
6. The automatic labeling device for port transportation data according to claim 5, characterized in that: The device also includes: The mapping module is used to establish the labels that need to be identified on the data annotation platform and establish the mapping relationship between each label and the predefined Schema of the UIE model.
7. The automatic labeling device for port transportation data according to claim 5, characterized in that: The device also includes: A connection module is used to connect the pre-trained UIE model with the data annotation platform through the target interface.
8. The automatic labeling method for port transportation data according to claim 5, characterized in that: The entity extraction module is specifically used for: Receive the entity extraction results in a unified format obtained by the UIE model after format conversion, wherein the format conversion is used to convert the entity extraction results in a unified format obtained by the UIE model into a format supported by the data annotation platform.
9. An electronic device / image signal generator / network device / transmitter / terminal / base station / industrial computer, characterized in that: include: at least one memory for storing a computer program; At least one processor is used to execute the program stored in the memory. When the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1 to 4.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program runs on a processor, the processor is caused to execute the method according to any one of claims 1 to 4.
