A text labeling method and device
By creating new annotation projects for the data sources to be annotated, establishing mapping relationships, and using text annotation models to connect two-dimensional and three-dimensional visualizations, the problem of insufficient annotation richness in existing technologies is solved, achieving richer and more flexible annotation effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN MEDICAL SHUN TECH CO LTD
- Filing Date
- 2021-06-10
- Publication Date
- 2026-05-29
AI Technical Summary
Existing text annotation methods are insufficient in terms of richness and effectiveness, and cannot effectively meet the annotation needs of complex data sources.
By creating new annotation projects for the data sources to be annotated, establishing mapping relationships, and using preset text annotation models for two-dimensional and three-dimensional visualization connections, combined with information enhancement and customizable shortcut key operations, rich annotation displays can be achieved.
It improves the annotation effect and content richness, supports multi-dimensional annotation display and security management, and enhances the flexibility and accuracy of annotation.
Smart Images

Figure CN114861612B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data labeling, in particular to a text labeling method and device. BACKGROUND
[0002] Text labeling is the basis for the development of artificial intelligence technology. In the field of artificial intelligence, model training and prediction result evaluation all require the use of "labeling tools". Text labeling not only produces various label data needed, but also visualizes the prediction results, making it convenient for engineers and customers to view the data prediction services provided by the model.
[0003] There are two main labeling directions for text labeling. One is the labeling of instances (objects) in machine vision, such as class, mask, and key points. The other is the labeling of serialized features such as entities and relationships in natural language.
[0004] There are many existing labeling methods, but labeling is limited to simple area labeling in the data source, and the available labeling content is limited, and the labeling richness is insufficient.
[0005] Therefore, a more rich labeling method is needed to improve the labeling effect. SUMMARY
[0006] Therefore, the purpose of the present application is to provide a text labeling method and device that can improve the labeling effect. The specific scheme is as follows:
[0007] A text labeling method, comprising:
[0008] Creating a labeling project for a data source to be labeled;
[0009] Establishing a first mapping relationship between the labeling project and the data source to be labeled, so as to view the data source to be labeled using the first mapping relationship;
[0010] Using a preset text labeling model to label visual connections of target labeling data in the data source to be labeled, so that users can view two-dimensional and / or three-dimensional specimen data corresponding to the target labeling data through the visual connections.
[0011] Optionally, the process of using a preset text labeling model to label visual connections of target labeling data in the data source to be labeled, so that users can view two-dimensional specimen data corresponding to the target labeling data through the visual connections, comprises:
[0012] The text labeling model is used to label target pixel points in the to-be-labeled data source, and corresponding two-dimensional display connections are added, so that a user views two-dimensional specimen data corresponding to the target labeled data through the two-dimensional display connections.
[0013] Optionally, the process of using the text labeling model to label the target pixel points in the to-be-labeled data source and adding corresponding two-dimensional display connections includes:
[0014] The text labeling model is used to render an expanded nine-square grid with the target pixel point as the center, and an arrow is used to point to a two-dimensional display connection existing in the nine-square grid and corresponding to the target pixel point.
[0015] Each grid in the nine-square grid is used to represent a two-dimensional display connection corresponding to the target pixel point.
[0016] Optionally, the process of using the preset text labeling model to label the target labeled data in the to-be-labeled data source and making a user view three-dimensional specimen data corresponding to the target labeled data through the visual connection includes:
[0017] The text labeling model is used to perform three-dimensional labeling on the target labeled data in the to-be-labeled data source, and a three-dimensional category layer corresponding to the target labeled data is provided.
[0018] Optionally, the process of using the text labeling model to perform three-dimensional labeling on the target labeled data in the to-be-labeled data source to obtain three-dimensional labeled data and using the three-dimensional labeled data to view a three-dimensional category layer of specimen data corresponding to the target labeled data includes:
[0019] The text labeling model is used to perform three-dimensional labeling on the target labeled data in the to-be-labeled data source by 3D rendering a sparse matrix to obtain three-dimensional labeled data, and the three-dimensional labeled data is used to view a three-dimensional category layer of specimen data corresponding to the target labeled data.
[0020] Optionally, the process further includes:
[0021] Existing historical labeled data in the to-be-labeled data source is obtained, and a second mapping relationship between the labeling project and the historical labeled data is established.
[0022] Optionally, after the labeling project is newly created for the to-be-labeled data source, the process further includes:
[0023] A corresponding project password is configured for the labeling project.
[0024] Optionally, the process further includes:
[0025] Information enhancement is performed on the labeled data and / or the historical labeled data in the data source to be labeled.
[0026] Optional, also includes:
[0027] Receive shortcut key customization information so that users can customize operation shortcut keys and realize control methods using keyboard keys, mouse keys, mouse pointer trails and / or gestures and combinations thereof.
[0028] The present invention also discloses a text annotation device, comprising:
[0029] Memory, used to store computer programs;
[0030] A processor for executing the computer program to implement the text annotation method as described above.
[0031] In this invention, the text annotation method includes: creating a new annotation project for the data source to be annotated; establishing a first mapping relationship between the annotation project and the data source to be annotated, so as to view the data source to be annotated using the first mapping relationship; and using a preset text annotation model to annotate the target annotation data in the data source to be annotated with a visual connection, so that users can view the two-dimensional and / or three-dimensional specimen data corresponding to the target annotation data through the visual connection.
[0032] This invention can create corresponding annotation items for each annotation, thereby distinguishing annotations for different purposes each time. At the same time, by using a text annotation model, the target annotation data in the data source to be annotated is visualized and connected. By setting up visualization connections, two-dimensional and / or three-dimensional specimen data can be displayed more effectively and centrally, improving the annotation effect. At the same time, the ability to annotate two-dimensional and / or three-dimensional specimen data increases the richness of the annotation content. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0034] Figure 1 This is a schematic diagram of a text annotation method disclosed in an embodiment of the present invention;
[0035] Figure 2 This is a schematic diagram of another text annotation method disclosed in an embodiment of the present invention;
[0036] Figure 3 This is a schematic diagram of a text annotation process disclosed in an embodiment of the present invention;
[0037] Figure 4 This is a comparative diagram illustrating the information enhancement effect disclosed in an embodiment of the present invention. Detailed Implementation
[0038] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0039] This invention discloses a text annotation method, see [link to relevant documentation]. Figure 1 As shown, the method includes:
[0040] S11: Create a new annotation project for the data source to be annotated;
[0041] S12: Establish the first mapping relationship between the labeled items and the data source to be labeled, so as to view the data source to be labeled using the first mapping relationship.
[0042] Specifically, a text can be annotated multiple times according to different needs. Since the content of each annotation is different in terms of classification and focus, in order to distinguish different annotations, a new annotation project is created for the data source to be annotated before each annotation. Different annotation projects are used to distinguish different annotations each time, so that annotation projects can be used to distinguish different batches of annotations from the same data source.
[0043] Specifically, after creating a new annotation project, a first mapping relationship is established between the annotation project and the data source to be annotated. Based on the first mapping relationship, the corresponding annotation data in the data source to be annotated can be viewed through the annotation project, thus establishing the correspondence between the annotation project and the data source to be annotated.
[0044] Specifically, the methods for creating annotation projects can include: 1. following the annotation project creation guide to create annotation projects from the folder containing the data source to be annotated; 2. following the annotation project creation guide to create annotation projects from the text containing the data source to be annotated; 3. using the folder containing the data source to be annotated to create a new annotation project via a shortcut key; 4. selecting the text containing the data source to be annotated to create a new annotation project via a shortcut key.
[0045] S13: Using a preset text annotation model, visual links are created to the target annotation data in the data source to be annotated, so that users can view the two-dimensional and / or three-dimensional specimen data corresponding to the target annotation data through the visual links.
[0046] Specifically, to enrich the annotation content, a preset text annotation model is used to match the target annotation data for the required visual connection from the data source to be annotated. After determining the target annotation data, a corresponding annotation visualization connection is created for it, so that users can view the two-dimensional and / or three-dimensional specimen data corresponding to the target annotation data through the visualization connection. By setting the visualization connection, the two-dimensional and / or three-dimensional specimen data can be displayed more effectively and centrally, improving the annotation effect. At the same time, the ability to annotate two-dimensional and / or three-dimensional specimen data increases the richness of the annotation content.
[0047] It should be noted that the preset text annotation model is a standard annotation model obtained by pre-training using historical data sources to be annotated. Therefore, it can effectively annotate the target labeled data in the data sources to be annotated.
[0048] As can be seen, the embodiments of the present invention can create corresponding annotation items for each annotation, thereby distinguishing annotations for different purposes each time. At the same time, by using the text annotation model, the target annotation data in the data source to be annotated is visualized and connected. By setting the visualization connection, the two-dimensional and / or three-dimensional specimen data can be displayed more effectively and centrally, improving the annotation effect. At the same time, the ability to annotate two-dimensional and / or three-dimensional specimen data increases the richness of the annotation content.
[0049] Furthermore, by utilizing text annotation models, text in the data source to be annotated can also be annotated to obtain annotated data. For example, by using text annotation models, text annotations of object categories, object masks, and text boundaries can be performed on the data source to be annotated to obtain annotated text data.
[0050] Specifically, it can perform regular object category annotation (BBox: bounding box annotation), object mask annotation, and during the annotation process, in addition to providing points, lines, rectangles, circles, ellipses, and polygons, it can also provide boundary annotations such as regular polygons that are adaptively generated based on the boundary. At the same time, based on the above methods, coarse annotation is performed to obtain the approximate area of the instance, and the boundary is fine-tuned by a boundary detection algorithm (the user can set the geometric characteristics of the specimen to enhance the detection algorithm) to obtain a precisely annotated specimen.
[0051] Furthermore, a cropping process, the reverse of the annotation process, can be provided, with the cropping method being the same as the annotation method. Users can crop a specific instance region, or perform intersection, union, complement, and difference operations on two or more instances to obtain a new instance region. In addition, after completing the annotation of a sample, users can use hotkeys to switch between annotated instances, enter a new instance annotation, switch to the sample to be annotated, and enter the display of annotated samples. Simultaneously, a specimen hiding function is also provided, which allows multiple specimens of the same sample to be annotated to be partially hidden, facilitating user observation and comparison of partial instances.
[0052] This invention discloses a specific text annotation method. Compared to the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:
[0053] Furthermore, the process of S13 above, which uses a preset text annotation model to annotate the target annotation data in the data source to be annotated with visual links, so that users can view the two-dimensional specimen data corresponding to the target annotation data through visual links, may include:
[0054] Using a text annotation model, target pixels in the data source to be annotated are labeled, and corresponding two-dimensional display links are added so that users can view the two-dimensional specimen data corresponding to the target annotation data through the two-dimensional display links.
[0055] Specifically, annotation can be performed using a pixel in the data source to be annotated as the base annotation point, and corresponding two-dimensional display connections can be added to improve the flexibility and accuracy of annotation. The specific annotation method can be to use a text annotation model to render an expanded nine-square grid centered on the target pixel, and use arrows to point to the two-dimensional display connections in the nine-square grid that correspond to the target pixel.
[0056] In this 3x3 grid, each cell represents a two-dimensional display connection corresponding to a target pixel.
[0057] Specifically, for a given pixel, there are exactly 8 neighboring pixels in the plane, corresponding to the eight directions: east, west, south, north, northeast, southeast, southwest, and northwest. Arranging these 8 directions along the channel dimension, the resulting label is actually a shape of [h, w, c], where h is the height of the text, w is the width of the text, and c = 8 * Instance_category_number. The third dimension, called the channel, has a size of c, which is 8 times the number of instance categories. Therefore, every 8 layers along the channel axis represent the connection status of an instance. For an instance, its connection status is such that all 8 connect values within it are 1. Only at the instance's boundary are some neighbors unconnected. Therefore, the sparse matrix only records the connect keypoints at the boundaries, which significantly reduces the sample size while maintaining the amount of information.
[0058] Specifically, two-dimensional specimen data refers to the connection display function on the source text, which can be switched to via hotkey to visualize the connection information of the mouse positioning point. The direction of the connection is shown with arrows, and the direction of the non-connection is not shown with any symbols. At the same time, the display area pointed to by all arrows is a magnified nine-square grid area. If there is no connection, only the nine-square grid is displayed.
[0059] Furthermore, the process of S13 above, which uses a preset text annotation model to annotate the target annotation data in the data source to be annotated with a visual link, so that users can view the 3D specimen data corresponding to the target annotation data through the visual link, may include:
[0060] Using a text annotation model, 3D annotations are performed on the target annotation data in the data source to be annotated, providing a 3D category layer corresponding to the target annotation data.
[0061] Specifically, 3D annotation can display a 3D category layer of specimen data, supporting operations such as rotation, scaling, and dragging of specimen data in 3D space, resulting in richer content. The annotation process can be described as follows: using a text annotation model, the target annotation data in the data source to be annotated is annotated in 3D using a 3D rendering sparse matrix to obtain 3D annotation data, which can then be used to view the 3D category layer of the specimen data corresponding to the target annotation data.
[0062] Specifically, since the number of annotations requiring visualization is relatively small compared to other types of annotations, and they exhibit clustering, an optimized sparse matrix can be used to store these multidimensional matrices in the connection visualization method. By preserving the three-dimensional boundaries in three-dimensional space, the amount of data stored is minimized without loss of information. The three-dimensional boundaries of the connection specimens refer to the key points of the annotation data in three-dimensional space.
[0063] Specifically, 3D display of connected specimens refers to rendering a sparse matrix in 3D on the annotation interface. The '1' parts are colored with a specific color from the color space, while the '0' parts are made transparent, ultimately forming a 3D display of the instance. The rendering interface supports operations such as zooming in, zooming out, and rotating the results. It also supports the joint display of annotated and predicted specimens. Virtualization technology is used to give some transparency to the overlapping parts, while highlighting the differences. Users can select instances in 3D space, i.e., observe only a specific instance, facilitating the observation of differences between them. Furthermore, the 2D and 3D connection display methods also support multi-layered display of connected specimens. Users can observe only a layer of a certain type of instance (8-channel layer), or even observe only a specific instance within those 8-channel layers.
[0064] Furthermore, this invention also discloses a text annotation method, see [link to relevant documentation]. Figure 2 and Figure 3 As shown, it includes:
[0065] S21: Create a new annotation project for the data source to be annotated;
[0066] S22: Configure the corresponding project password for the labeled project.
[0067] Specifically, you can configure a password for each labeled item, so that only users with the password can view the corresponding labeled item. This is equivalent to setting access permissions for each labeled item, which improves security.
[0068] S23: Establish the first mapping relationship between the labeled items and the data source to be labeled, so as to use the first mapping relationship to view the data source to be labeled;
[0069] S24: Obtain existing historical annotation data from the data source to be annotated, and establish a second mapping relationship between annotation items and historical annotation data.
[0070] Specifically, since there may already be other annotation projects in the data source to be annotated before the creation of this annotation project, according to the user's selection, the existing historical annotation data in the data source to be annotated can be obtained to establish a second mapping relationship between the annotation project and the historical annotation data. In this way, the annotation data previously annotated can also be viewed through the current annotation project.
[0071] S25: Using a preset text annotation model, visual links are created to the target annotation data in the data source to be annotated, so that users can view the two-dimensional and / or three-dimensional specimen data corresponding to the target annotation data through the visual links.
[0072] S26: Enhance the information in the labeled data and / or historical labeled data in the data source to be labeled.
[0073] Furthermore, information augmentation can be performed on the labeled data and / or historical labeled data in the data source to be labeled, see [link to documentation]. Figure 4 As shown, this includes displaying existing labeled data for the current text, such as category display, mask display, key point display, and connection display. The data augmentation method also supports importing existing machine learning models. This method can drive existing models to obtain predicted samples of the text to be labeled and supports displaying these predicted samples on top of the source image. Another key aspect of the information augmentation module is its support for adaptive revision of labeled information. For example, labeled samples in mask regions may have jagged edges, causing intrusion into instances, or may contain background and other instances. In this case, the adaptive detection method will use an optimization algorithm to detect boundaries to obtain better mask label boundaries, facilitating finer labeling and improving labeling efficiency. The boundary detection method of the information augmentation method also supports revision mode settings. For example, for certain text data, boundaries are generally presented as horizontal or vertical straight lines with vertical corners. Users can set corresponding modes to make boundary detection and revision more accurate.
[0074] S27: Receive shortcut key customization information so that users can customize operation shortcut keys and realize control methods using keyboard keys, mouse keys, mouse pointer trails and / or gestures and combinations thereof.
[0075] Specifically, to enhance user experience, the system can receive custom shortcut key information, allowing users to define their own shortcuts and control operations using keyboard keys, mouse buttons, mouse pointer movements, and / or gestures and combinations thereof. After completing a sample annotation, users can use hotkeys to switch between annotated instances, enter a new instance annotation, switch samples to be annotated, and access the displayed annotated samples. Additionally, a specimen hiding function is provided, allowing users to partially hide multiple specimens of the same unannotated sample for easier observation and comparison of specific instances.
[0076] Furthermore, after a text annotation project is completed, the annotation samples can be exported after authentication. After authentication, all annotation samples of the current project can be exported as plaintext for use in AI model training. Alternatively, samples from different projects with the same data source can be integrated together, and samples of certain categories or data (text to be annotated) from the current project can be exported in plaintext.
[0077] As can be seen, this invention can separate the permissions for annotation work and the use of annotated specimens. Administrators can have exclusive access, while annotators cannot use the plaintext annotations of the project. This is beneficial for protecting annotated specimens, preventing accidental leakage of annotated data, and provides annotation formats such as regular polygons, connections, and custom label types, opening up possibilities for more annotated data types and facilitating researchers to propose new models. The boundary detection algorithm used in this invention optimizes the annotators' annotated specimens, achieving automated and precise annotation work. Simultaneously, utilizing multi-dimensional specimen display functions, it provides users with the ability to display and compare annotated and predicted specimens. It also supports specimen export, which can be password-verified and exported in various forms of plaintext. These mainly include exporting specimens from the current project, exporting specimens from multiple projects using the same data source, exporting specimens containing partial data from the current project's data source, and exporting specimens from specific specimen types within the data source. Furthermore, it supports the import of multilingual AI models and the loading of plaintext specimens for model use. This can reduce the workload of programmers in data preprocessing.
[0078] Furthermore, embodiments of the present invention also disclose a text annotation device, comprising:
[0079] Memory, used to store computer programs;
[0080] A processor is used to execute computer programs to implement text annotation methods as described above.
[0081] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0082] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0083] The technical content provided by the present invention has been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A text annotation method, characterized in that, include: Create a new annotation project for the data source to be annotated; Establish a first mapping relationship between the labeled items and the data source to be labeled, so as to use the first mapping relationship to view the data source to be labeled; Using a preset text annotation model, visual links are annotated to the target annotation data in the data source to be annotated, so that users can view the two-dimensional and / or three-dimensional specimen data corresponding to the target annotation data through the visual links; The process of using a preset text annotation model to annotate the target annotation data in the data source to be annotated with visual links, so that users can view the two-dimensional specimen data corresponding to the target annotation data through the visual links, includes: Using the text annotation model, target pixels in the data source to be annotated are annotated, and corresponding two-dimensional display links are added so that users can view two-dimensional specimen data corresponding to the target annotation data through the two-dimensional display links; The process of using the text annotation model to annotate target pixels in the data source and adding corresponding two-dimensional display connections includes: Using the text annotation model, an expanded nine-square grid is rendered with the target pixel as the center, and arrows are used to point to the two-dimensional display connections in the nine-square grid that correspond to the target pixel. Each cell in the 3x3 grid represents a two-dimensional display connection corresponding to the target pixel.
2. The text annotation method according to claim 1, characterized in that, The process of using a preset text annotation model to annotate the target annotation data in the data source to be annotated with visual links, so that users can view the 3D specimen data corresponding to the target annotation data through the visual links, includes: Using the text annotation model, the target annotation data in the data source to be annotated is annotated in three dimensions, and a three-dimensional category layer corresponding to the target annotation data is provided.
3. The text annotation method according to claim 2, characterized in that, The process of using the text annotation model to perform 3D annotation on the target annotation data in the data source to be annotated, obtaining 3D annotated data, and using the 3D annotated data to view the 3D category layer of the specimen data corresponding to the target annotation data includes: Using the text annotation model, the target annotation data in the data source to be annotated is annotated in three dimensions by using a 3D rendering sparse matrix to obtain three-dimensional annotation data, so as to view the three-dimensional category layer of the specimen data corresponding to the target annotation data.
4. The text annotation method according to any one of claims 1 to 3, characterized in that, Also includes: Obtain existing historical annotation data from the data source to be annotated, and establish a second mapping relationship between the annotation item and the historical annotation data.
5. The text annotation method according to any one of claims 1 to 3, characterized in that, After creating a new annotation project for the data source to be annotated, the process also includes: Configure the corresponding project password for the labeled project.
6. The text annotation method according to any one of claims 1 to 3, characterized in that, Also includes: Information enhancement is performed on the labeled data and / or historical labeled data in the data source to be labeled.
7. The text annotation method according to any one of claims 1 to 3, characterized in that, Also includes: Receive shortcut key customization information so that users can customize operation shortcut keys and realize control methods using keyboard keys, mouse keys, mouse pointer trails and / or gestures and combinations thereof.
8. A text annotation device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the text annotation method as described in any one of claims 1 to 7.