Labeling component, labeling method, device, equipment and storage medium

By separating the text layer and the tag layer, the text sequence and DOM elements are displayed separately, which solves the rendering lag problem during text sequence annotation and achieves an efficient text annotation process.

CN113807049BActive Publication Date: 2024-11-12ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010543444.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-15
Publication Date
2024-11-12
Estimated Expiration
2040-06-15

AI Technical Summary

Technical Problem

In existing technologies, the text sequence needs to be re-rendered each time an entity in the text sequence is labeled, which causes rendering stuttering.

Method used

The design employs a separation of text and tag layers. The target text sequence is displayed through the first text node, and each character is split into a single HTML text node. The user selects an HTML text node and adds a DOM element in the second text node. The tag layer renders and displays the DOM element, avoiding the need to re-render the target text sequence.

Benefits of technology

Adding DOM elements eliminates the need to re-render the target text sequence, avoiding rendering stuttering issues and improving annotation efficiency and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113807049B_ABST
    Figure CN113807049B_ABST
Patent Text Reader

Abstract

The present invention discloses a marking component, a marking method, an apparatus, a device and a storage medium, wherein the marking component comprises: a text layer and a tag layer; the text layer comprises: a first text node for displaying a target text sequence; and a second text node for splitting each character of the target text sequence into a single hypertext markup language HTML text node for display, and receiving a user's interactive action; wherein the interactive action is used to select at least one HTML text node from the HTML text nodes of the target text sequence, and to add a first DOM element to a first marked text corresponding to the at least one HTML text node; the tag layer is used to render the first DOM element and display the rendered first DOM element. According to an embodiment of the present invention, when marking the first marked text, it is not necessary to re-render the target text sequence, thereby avoiding the problem of freezing during rendering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computers, and in particular relates to a labeling component, a labeling method, a device, a equipment and a storage medium. Background Art

[0002] With the rapid development of machine learning technology, machine learning models have been widely used in various industries. Before using the machine learning model for prediction, the machine learning model is trained with training samples. In order to obtain training samples, the staff needs to annotate the text in the text sequence. For example, the names of people, places, and time in the text sequence are annotated. The annotated text sequence forms a training sample.

[0003] The text annotation method in the related art is: the user selects the entity to be annotated in the displayed text sequence; then the system wraps the entity to be annotated in an entity tag, and uses the entity tag to replace the entity to be annotated in the text sequence.

[0004] It can be seen that every time the user annotates an entity in a text sequence, the text sequence changes. Since the text sequence changes, the text sequence needs to be re-rendered. Each re-rendering of the text sequence consumes resources. If the text sequence is too long, it is likely to cause a freeze in the rendering. Summary of the invention

[0005] Embodiments of the present invention provide a labeling component, a labeling method, an apparatus, a device and a storage medium, which can solve the problem that a text sequence needs to be re-rendered each time an entity in a text sequence is labeled, resulting in a freeze during rendering.

[0006] In a first aspect, an embodiment of the present invention provides a labeling component, including: a text layer and a label layer;

[0007] The text layer includes:

[0008] The first text node is used to display the target text sequence;

[0009] as well as,

[0010] The second text node is used to split each character of the target text sequence into a single Hypertext Markup Language HTML text node for display, and receive a user's interactive action; wherein the interactive action is used to select at least one HTML text node from the HTML text nodes of the target text sequence, and add a first DOM element to a first annotation text corresponding to the at least one HTML text node;

[0011] The tag layer is used to render the first DOM element and display the rendered first DOM element.

[0012] In a second aspect, an embodiment of the present invention provides a marking method, which uses the marking component described in the first aspect to perform marking, and the method includes:

[0013] Using the first text node to display the target text sequence, and using the second text node to split each character of the target text sequence into a single HTML text node for display;

[0014] Receiving a user's interactive action on the target text sequence using the second text node, wherein the interactive action is used to select at least one HTML text node from the HTML text nodes in the target text sequence, and adding a first DOM element to a first annotation text corresponding to the at least one HTML text node;

[0015] The first DOM element is rendered using the tag layer, and the rendered first DOM element is displayed.

[0016] In a third aspect, an embodiment of the present invention provides a labeling device, which uses the labeling component described in the first aspect to perform labeling, and the device includes:

[0017] A first display module, configured to display a target text sequence using the first text node, and to display each character of the target text sequence as a single HTML text node using the second text node;

[0018] an action receiving module, configured to receive a user's interactive action on the target text sequence using the second text node, wherein the interactive action is used to select at least one HTML text node from the HTML text nodes in the target text sequence, and add a first DOM element to a first annotation text corresponding to the at least one HTML text node;

[0019] A first rendering module, used to render the first DOM element using the tag layer;

[0020] The second display module is used to display the rendered first DOM element.

[0021] In a fourth aspect, an embodiment of the present invention provides a labeling device, the device comprising: a processor and a memory storing computer program instructions;

[0022] When the processor executes the computer program instructions, the marking method described in the second aspect is implemented.

[0023] In a fifth aspect, an embodiment of the present invention provides a computer storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the marking method described in the second aspect is implemented.

[0024] The annotation component, annotation method, device, equipment and storage medium of the embodiment of the present invention display the target text sequence through the first text node, and split each character of the target text sequence into a single HTML text node for display through the second text node. Thus, the user can select at least one HTML text node through the second text node, and add a first DOM element to the first annotation text corresponding to the selected at least one HTML text node. Render and display the first DOM element on the tag layer. It can be seen that the embodiment of the present invention displays the target text sequence and the first DOM element on different layers, so that the rendering of the target text sequence and the first DOM element does not affect each other. Therefore, in the case of adding the first DOM element, it is sufficient to render the first DOM element on the tag layer, and there is no need to re-render the target text sequence, thereby avoiding the problem of jamming during rendering. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following is a brief introduction to the drawings required for use in the embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0026] Figure 1 A schematic diagram showing the structure of a labeling component according to an embodiment of the present invention is shown;

[0027] Figure 2 A schematic diagram showing the structure of a labeling component of another embodiment provided by the present invention is shown;

[0028] Figure 3 A schematic diagram showing a labeling result of an embodiment provided by the present invention;

[0029] Figure 4 A flowchart of a marking method provided in an embodiment of the present application;

[0030] Figure 5 A schematic diagram showing the structure of a labeling component according to another embodiment of the present invention is shown;

[0031] Figure 6 A schematic structural diagram of a labeling component according to another embodiment of the present invention is shown;

[0032] Figure 7 A schematic diagram of another marking method provided in an embodiment of the present application;

[0033] Figure 8 A schematic diagram of a process of associating two annotated texts according to an embodiment of the present invention is shown;

[0034] Fig. 9 A schematic structural diagram of a marking device according to an embodiment of the present invention is shown;

[0035] Fig.10 A schematic diagram of the hardware structure of a labeling device provided in an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0036] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.

[0037] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0038] First, the professional terms involved in the embodiments of the present invention are explained below.

[0039] Text sequence annotation: including word segmentation, named entity recognition, part-of-speech tagging, etc. Specifically, it includes annotating at least one word (such as a character or word) w in a text sequence with its specific tag set. Therefore, for a given text sequence W, we can get its label a in the label set The label sequence A on the text sequence W is implemented to realize the sequence labeling task from the text sequence W to the label sequence A.

[0040] Text entity extraction: also known as named entity recognition, specifically annotating a label set for entities in a text sequence One or more tags. At least one word (i.e., annotated text) annotated with a tag is called an entity.

[0041] Text relation extraction: For a given text sequence and its entity set E, mark the entity tuple (e1, e2) and its relationship label r that conforms to the given relationship label set R, and call (r, e1, e2) a relationship. The relationship mentioned in the embodiments of the present invention may refer to a binary relationship, that is, a relationship between two entities.

[0042] Scalable Vector Graphics (SVG): A language defined in Extensible Markup Language (XML) that is used to describe scalable vector graphics. SVG graphics perform well in browsers, are easy to use, and are suitable for data visualization on the Web.

[0043] The above is a description of the professional terms involved in the embodiments of the present invention. The following is a description of the relevant technologies of the embodiments of the present invention.

[0044] The Natural Language Processing (NLP) self-learning platform supports the output of a variety of NLP basic algorithm model capabilities, such as text entity extraction, text relationship extraction, and text classification. These capabilities will also be open to users in the NLP self-learning platform. Users need to train the model by annotating text sequences to adapt to entity extraction, relationship extraction, and classification of content in different fields. Therefore, as a one-stop data management, model training, deployment, and iteration platform, it is necessary to provide a simple and easy-to-use annotation tool in the NLP self-learning platform for users to annotate.

[0045] One annotation method in the related art is: the user selects the entity to be annotated in the displayed text sequence; then the system wraps the entity to be annotated in an entity tag, and uses the entity tag to replace the entity to be annotated in the text sequence.

[0046] Another text annotation method in the related art is to implement text annotation based on two-way data binding of front-end frameworks such as React. Specifically, the text sequence is segmented or split at the character level; and the annotation results are bound to the relevant character elements.

[0047] In the above two annotation methods, every time the user annotates an entity in a text sequence, the text sequence changes. Since the text sequence has changed, the text sequence needs to be re-rendered. And each re-rendering of the text sequence consumes resources. In fact, when users use annotation tools to annotate, it is found that users often upload relatively long text sequences. If the text sequence is too long, it is very likely that there will be a freeze when rendering the text sequence.

[0048] In view of the above technical problem, an embodiment of the present invention provides a marking component, which includes a text layer and a label layer.

[0049] The text layer includes: a first text node and a second text node.

[0050] The first text node is used to display the target text sequence.

[0051] The second text node is used to split each character of the target text sequence into a single HyperText Markup Language (HTML) text node for display, and to receive user interaction; wherein the interaction is used to select at least one HTML text node from the HTML text nodes of the target text sequence, and to add a first DOM (Document Object Model) element to a first annotation text corresponding to the at least one HTML text node.

[0052] The tag layer is used to render the first DOM element and display the rendered first DOM element.

[0053] It should be noted that the layer positions of the first text node and the second text node can be interchanged, for example, the first text node is above the second text node, or the second text node is above the first text node.

[0054] In addition, if other texts in the target text sequence except the first annotated text have been annotated with DOM elements, then when rendering the first DOM element of the first annotated text on the tag layer, it is also necessary to re-render the DOM elements of other annotated texts on the tag layer. In this way, the rendering cost in the embodiment of the present application is related to the number of DOM elements on the tag layer and has nothing to do with the length of the target text sequence. However, due to the limited number of DOM elements on the tag layer, the rendering cost of the embodiment of the present invention is much lower than the cost of rendering the entire target text sequence.

[0055] Combine the following Figure 1 Describe the annotation components of the embodiment of the present application.

[0056] refer to Figure 1, the target text sequence is displayed on the first text node and the second text node respectively. "May 21, 2014" on the first text node is an HTML text node. Each character in the target text sequence on the second text node is displayed as a single HTML text node. That is, "2", "0", "1", "4", "year", "0", "5", "month", "2", "1", and "day" are single HTML text nodes respectively.

[0057] The user's interactive action is received through the second text node, and the interactive action is used to select the text node "May 21, 2014" in the HTML text node of the target text sequence, and add the first DOM element "date" to the first annotation text corresponding to the text node. The first DOM element "date" is displayed on the label layer. In this way, the user can annotate the text in the target text sequence.

[0058] In an embodiment of the present invention, a target text sequence is displayed through a first text node, and each character of the target text sequence is split into a single HTML text node for display through a second text node. Thus, a user can select at least one HTML text node through the second text node, and add a first DOM element to the first annotation text corresponding to the selected at least one HTML text node. The first DOM element is rendered and displayed on the tag layer. It can be seen that the embodiment of the present invention displays the target text sequence and the first DOM element on different layers, so that the rendering of the target text sequence and the first DOM element does not affect each other. Therefore, in the case of adding the first DOM element, it is sufficient to render the first DOM element on the tag layer, and there is no need to re-render the target text sequence, thereby avoiding the problem of jamming during rendering.

[0059] In addition, since the first text node is used to display the target text sequence and the second text node is used for the user to select the annotated text, that is, the first text node and the second text node have different divisions of labor, this avoids affecting the display of the target text sequence when the user selects the annotated text, thereby ensuring the normal display of the target text sequence.

[0060] In addition, due to the diversity of the fields it targets, the DOM element of an annotated text is not unique, and some annotated texts may be marked as multiple different DOM elements. Therefore, it is necessary to cross-extract or overlap the text sequence and mark it. For example, the DOM element that needs to be marked as "18:00, May 21, 2014" is the time, and the DOM element that is marked as "May 21, 2014" is the date, that is, "May 21, 2014" is the cross-extracted part. However, in the related art, the annotated text to be marked is wrapped in an annotated text DOM element, and the annotated text DOM element is used to replace the annotated text to be marked in the text sequence. Since one annotated text can only replace an annotated text DOM element once, it can be seen that the related art cannot support cross-extraction or overlap extraction of text sequences.

[0061] In the embodiment of the present application, since each character in the target text sequence is displayed on the second text node as a single hypertext markup language text node, after the user selects one or more HTML text nodes from the second text node and annotates the first annotated text corresponding to the selected HTML text node, the user can also select the previously selected HTML text node for annotation without wrapping the entity tag, thereby supporting cross- or overlapping extraction of annotated text.

[0062] The embodiment of the present invention is insensitive to the length of the target text sequence and can support the annotation of target text sequences of tens of thousands of words. The rendering performance is related to the number of annotation results, but under the incremental update strategy, the performance is better than the two-way data binding solution based on the front-end framework. Practice has proved that in actual application environments, when the length of the target text sequence reaches more than 5,000 words, the performance consumption of the annotation component using the two-way data binding in the related technology is already large, and there is obvious lag; when the length of the target text sequence reaches 10,000 words, it is basically unusable. Using the annotation component of the embodiment of the present invention, annotation is performed on a target text sequence of 40,000 words, and it can still be guaranteed to be available when annotating more than 500 entities (the entities are the annotated texts mentioned above).

[0063] In one or more embodiments of the present application, the annotation component further includes: a graphics layer.

[0064] The graphic layer is used to render the graphic elements of the first annotation text and display the rendered graphic elements.

[0065] Optionally, the graphics layer may be an SVG layer.

[0066] In one or more embodiments of the present application, the graphic element includes at least one of the following: a background color block of the first annotation text, used to represent a connecting line having an associated relationship between the first annotation text and the second annotation text.

[0067] The following combines Figure 2 to illustrate the embodiments of the present application.

[0068] As Figure 2 shown, when adding the first DOM element "date" to the first marked text "May 21, 2014", the first DOM element "date" of "May 21, 2014" is rendered on the label layer; the background color block of "May 21, 2014" is rendered on the graphic layer.

[0069] In Figure 2 , the graphic layer is located below the label layer and the text layer. Among them, the positions of the label layer and the text layer can be interchanged. For example, the label layer, the text layer, and the graphic layer are arranged in sequence from top to bottom; or, the text layer, the label layer, and the graphic layer are arranged in sequence from top to bottom.

[0070] In addition, the graphic element may further include a connection line for indicating an association relationship between the first marked text and the second marked text. For example, referring to Figure 3 , the first marked text is "Zhang San", and the second marked text is "** City ** Road ** Community". The connection line between "Zhang San" and "** City ** Road ** Community" is shown through the graphic layer. Since "Zhang San" and "** City ** Road ** Community" are on the same line, the connection line between "Zhang San" and "** City ** Road ** Community" is a same-line connection line.

[0071] For another example, continuing to refer to Figure 3 , the first marked text is "Zhang San", and the second marked text is "Phone 136*********". The connection line between "Zhang San" and "Phone 136*********" is shown through the graphic layer. Since "Zhang San" and "Phone 136*********" are not on the same line, the connection line between "Zhang San" and "Phone 136*********" is a cross-line connection line.

[0072] In the embodiments of the present application, the user may need to interact with the first DOM element of the first marked text. For example, modifying the first DOM element, and the user does not need to interact with the graphic element of the first marked text. Based on whether the user needs to interact, the first DOM element and the graphic element of the first marked text are respectively rendered on different layers, avoiding the influence on the display of the graphic element when the user interacts with the first DOM element.

[0073] In addition, the graphic elements that do not interact with the user are displayed on the graphic layer, so that the graphic elements, DOM elements and target text sequences are displayed on different layers. Therefore, when the graphic elements are modified (such as adding or deleting graphic elements), it is avoided to re-render the target text sequence and DOM elements when rendering the modified graphic elements, thereby avoiding the jamming problem caused by re-rendering the target text sequence and DOM elements.

[0074] In one or more embodiments of the present application, the tag layer is also used to detect whether the first DOM element and the second DOM element overlap when displayed on the tag layer, and if the first DOM element and the second DOM element overlap, adjust the position of the first DOM element and / or the second DOM element on the tag layer so that the first DOM element and the second DOM element do not overlap when displayed on the tag layer; wherein the second DOM element is any DOM element displayed on the tag layer except the first DOM element.

[0075] In the embodiment of the present application, it is detected whether the first DOM element overlaps with other second DOM elements displayed on the tab layer, and when the two overlap, the positions of the two are adjusted so that the two do not overlap, thereby avoiding affecting the display effect of the DOM elements on the tab layer.

[0076] In one or more embodiments of the present application, the target text sequences displayed by the first text node and the second text node respectively have the same content, and the same character in the target text sequence has the same position on the first text node and the second text node.

[0077] In the embodiment of the present application, the target text sequences displayed on the first text node and the second text node overlap, so as to avoid ghosting of the displayed target text sequence and thus affect the display effect.

[0078] In one or more embodiments of the present application, the first DOM element includes at least one of a DOM tag and an association relationship; wherein the association relationship is an association relationship between a first annotated text and a second annotated text; wherein the second annotated text is any one of the annotated texts in the target text sequence.

[0079] Since users may need to interact with DOM tags and relationships, for example, modify the relationships, the relationships are displayed on the tag layer.

[0080] For example, continue to refer to Figure 3 , the association relationship between "Zhang San" and "** City ** Road ** Community" is rendered as a "resident" relationship on the label layer, and the association relationship between "Zhang San" and "Phone 136*********" is rendered as a "telephone" relationship on the label layer.

[0081] Based on the above-mentioned annotation components, the present application provides a annotation method, which uses the above-mentioned annotation components for annotation. Figure 4 A flowchart of a marking method provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the annotation methods include:

[0082] S101, using a first text node to display a target text sequence, and using a second text node to split each character of the target text sequence into a single HTML text node for display;

[0083] S102, receiving an interactive action of a user on a target text sequence using a second text node, wherein the interactive action is used to select at least one HTML text node from the HTML text nodes of the target text sequence, and add a first DOM element to a first annotation text corresponding to the at least one HTML text node;

[0084] S103: Render the first DOM element using the tag layer, and display the rendered first DOM element.

[0085] In an embodiment of the present application, a target text sequence is displayed using a first text node, and each character of the target text sequence is split into a single HTML text node for display using a second text node. Thus, a user can select at least one HTML text node through the second text node, and add a first DOM element to the first annotation text corresponding to the selected at least one HTML text node. The first DOM element is rendered and displayed using a tag layer. It can be seen that the embodiment of the present invention displays the target text sequence and the first DOM element on different layers, so that the rendering of the target text sequence and the first DOM element do not affect each other. Therefore, in the case of adding the first DOM element, it is sufficient to render the first DOM element on the tag layer, and there is no need to re-render the target text sequence, thereby avoiding the problem of jamming during rendering.

[0086] In one or more embodiments of the present application, after receiving the user's interactive action on the target text sequence using the second text node, the annotation method further includes:

[0087] The graphic element of the first annotation text is rendered using the graphic layer, and the rendered graphic element is displayed.

[0088] Since it has been described above that the graphic layer renders and displays the graphic elements of the first annotation text, it will not be repeated here.

[0089] In one or more embodiments of the present application, when the graphic element includes a background color block of the first annotation text and the first annotation text includes a plurality of characters, before rendering the graphic element of the first annotation text using the graphic layer, the annotation method further includes:

[0090] Determine whether multiple characters of the first marked text are rendered on the same line or the same column of the second text node. Among them, there are the following two judgment results:

[0091] 1. Multiple characters of the first marked text are rendered on the same line or the same column of the second text node

[0092] In this case, obtain the first starting position of the first character among the multiple characters on the second text node and the first ending position of the last character among the multiple characters on the second text node; obtain the first target position corresponding to the first starting position and the second target position corresponding to the first ending position on the graphic layer; take the area between the first target position and the second target position on the graphic layer as the target area.

[0093] Display the rendered graphic element, specifically including: displaying the rendered background color block in the target area of the graphic layer.

[0094] For example, refer to Figure 5 ,"May 21, 2014" is rendered on the same line of the second text node. Obtain the first starting position 202 of the first character '2' among the multiple characters on the second text node and the first ending position 203 of the last character 'day' on the second text node; obtain the first target position 204 corresponding to the first starting position 202 and the second target position 205 corresponding to the first ending position 203 on the graphic layer. The top position 206 and the bottom position 207 of the target area on the graphic layer are predetermined, and the first target position 204, the second target position 205, the top position 206, and the bottom position 207 on the graphic layer form the target area 208.

[0095] 2. Multiple characters of the first marked text are not rendered on the same line or the same column of the second text node

[0096] In this case, obtain N character segments on which the multiple characters are rendered on N lines or N columns, where N is an integer greater than or equal to 2; obtain the target areas corresponding to each character segment on the graphic layer.

[0097] Display the rendered graphic element, specifically including: displaying the rendered background color block in the target area of the graphic layer.

[0098] Among them, obtaining the target area corresponding to a character segment on the graphic layer specifically includes:

[0099] Obtain the second starting position of the first character of the character segment on the text layer and the second ending position of the last character of the character segment on the text layer;

[0100] Obtain a third target position corresponding to the second starting position and a fourth target position corresponding to the second ending position on the graphic layer;

[0101] Take the area between the third target position and the fourth target position on the graphic layer as the target area corresponding to the character segment.

[0102] For example, referring to Figure 6 , the first marked text is "May 21, 2014". Among them, "May 2014" is located at the last position of the first line, and "21st" is located at the starting position of the second line. For one character segment "May 2014", obtain the starting position 209 of the first character "2" of this character segment on the text layer and the ending position 210 of the last character "month" of this character segment on the text layer. Obtain the target position 211 corresponding to the starting position 209 and the target position 212 corresponding to the ending position 210 on the graphic layer. Since the top position and the bottom position of the line corresponding to "May 2014" on the graphic layer are preset, therefore, the area between the target position 211 and the target position 212 on the line corresponding to "May 2014" on the graphic layer can be taken as the target area 213 corresponding to "May 2014". Display a part of the rendered background color block within this target area 213.

[0103] Similarly, for another character segment "21st", obtain the target position 214 corresponding to the starting position of the first character "2" of this character segment on the graphic layer, and the target position 215 corresponding to the ending position of the last character "st" of this character segment. Take the area between the target position 214 and the target position 215 on the line corresponding to "21st" on the graphic layer as the target area 216 corresponding to "21st". Display another part of the rendered background color block within this target area 216. Thus, the background color block of "May 21, 2014" is displayed on the graphic layer, achieving Figure 6 the effect shown in 217.

[0104] In the embodiments of the present invention, by determining whether multiple characters of the first marked text are rendered on the same row or the same column of the second text node. If multiple characters of the first marked text are rendered on the same row or the same column of the second text node, then determine a target area on the graphic layer and display the background color block of the first marked text within the target area. If multiple characters of the first marked text are not rendered on the same row or the same column of the second text node, then determine multiple target areas on the graphic layer and display the background color blocks within each target area respectively. Thus, the background color block of the first marked text is displayed on the graphic layer.

[0105] In one or more embodiments of the present application, before displaying the rendered first DOM element, the marking method further includes:

[0106] Using the label layer to detect whether the first DOM element and the second DOM element overlap when displayed on the label layer;

[0107] When the first DOM element overlaps with the second DOM element, the position of the first DOM element and / or the second DOM element on the label layer is adjusted by using the label layer so that the first DOM element and the second DOM element do not overlap when displayed on the label layer;

[0108] The second DOM element is any DOM element displayed on the tag layer.

[0109] In the embodiment of the present application, it is detected whether the first DOM element overlaps with other second DOM elements displayed on the tab layer, and when the two overlap, the positions of the two are adjusted so that the two do not overlap, thereby avoiding affecting the display effect of the DOM elements on the tab layer.

[0110] Below through Figure 7 The above embodiment is further described. Figure 7 FIG. 2 is a flow chart of a marking method according to another embodiment of the present invention. Figure 7 As shown, the annotation methods include:

[0111] S301, receiving a target text sequence uploaded by a user.

[0112] S302, initializing a target text sequence, specifically using the first text node to display the target text sequence, and using the second text node to split each character of the target text sequence into a single HTML text node for display.

[0113] S303, rendering the existing annotation results of each entity in the target text sequence, specifically, rendering the DOM elements of each entity in the target text sequence on the DOM tag layer, and rendering the background color blocks of each entity on the graphic layer.

[0114] S304, receiving a user's interactive action on the target text sequence using the second text node, wherein the interactive action is used to select at least one HTML text node from the HTML text nodes of the target text sequence, and add a first DOM element to the first annotation text corresponding to the at least one HTML text node.

[0115] S305, determining whether the multiple characters of the first annotated text are in the same row. If it is determined that the multiple characters of the first annotated text are in the same row, S306 is executed; if it is determined that the multiple characters of the first annotated text are not in the same row, S307 is executed.

[0116] S306: Obtain the position of the first annotated text in the target text sequence, including the position of the first letter of the first annotated text and the position of the last letter of the first annotated text.

[0117] S307, determine the line break position. The line break position refers to the position where multiple characters of the first annotation text are separated. For example, from the first character of the first annotation text to the character A in the first annotation text are in the same line, from the character B in the first annotation text to the last character in the first annotation text are in another line, and the character A is adjacent to the character B. Then, the line break position includes the end position of the character A and the start position of the character B.

[0118] S308, draw the first DOM element of the first annotation text and the background color block. The background color block is drawn in the target area on the graphics layer. The above has described in detail how to obtain the target area, which will not be repeated here.

[0119] S309: Render the first DOM element using the tag layer and display the rendered first DOM element; render the background color block of the first annotation text using the graphic layer and display the rendered background color block.

[0120] In one or more embodiments of the present invention, after S103, the marking method further includes:

[0121] receiving an action of a user associating a first annotated text with a second annotated text in a target text sequence;

[0122] In response to the associated action, the fifth target position of the first annotated text on the second text node and the sixth target position of the second annotated text on the second text node are obtained; wherein the fifth target position can be the starting position, the ending position, or any position in the middle of the first target character in the first annotated text on the second text node. The sixth target position can be the starting position, the ending position, or any position in the middle of the second target character in the second annotated text on the second text node. The first target character can be the first character, the last character, or any character in the middle of the first annotated text. The second target character can be the first character, the last character, or any character in the middle of the second annotated text.

[0123] Acquire, on the label layer, a seventh target position corresponding to the fifth target position and an eighth target position corresponding to the sixth target position;

[0124] According to the seventh target position and the eighth target position, a connection line for indicating the association relationship between the first annotation text and the second annotation text is rendered on the graphics layer, and the connection line is displayed on the graphics layer.

[0125] In one or more embodiments of the present invention, rendering a connection line for indicating an association relationship between the first annotation text and the second annotation text on the graphics layer according to the seventh target position and the eighth target position includes:

[0126] Determine whether the first annotation text and the second annotation text are rendered in the same row or column of the second text node;

[0127] When the first annotation text and the second annotation text are rendered in the same row or the same column on the second text node, a connecting line from the seventh target position to the eighth target position is rendered on the graphics layer;

[0128] When the first annotation text and the second annotation text are not rendered in the same row or column on the second text node, a connecting line from the seventh target position to the end position of the row or column corresponding to the first annotation text, and a connecting line from the starting position of the row or column where the second annotation text is located to the eighth target position are rendered on the graphics layer.

[0129] Below through Figure 8 The above embodiment is further described. Figure 8 FIG. 1 is a flow chart showing an embodiment of the present invention for associating two annotated texts. Figure 8 As shown, associating two annotation texts may include:

[0130] S401: receiving an action of a user associating a first annotated text with a second annotated text in a target text sequence.

[0131] S402, determining whether the first annotation text and the second annotation text are rendered in the same line of the second text node. If it is determined that the first annotation text and the second annotation text are rendered in the same line of the second text node, executing S403. If it is determined that the first annotation text and the second annotation text are not rendered in the same line of the second text node, executing S405.

[0132] S403, obtaining the positions of the first annotated text and the second annotated text on the second text node. For example, the positions include the ending position of the ending character of the first annotated text on the second text node and the starting position of the first character of the second annotated text on the second text node.

[0133] S404: Draw an inline connecting line from the first annotation text to the second annotation text on the graphic layer according to the positions of the first annotation text and the second annotation text on the second text node.

[0134] S405, determining the line break position of the connecting line, which includes the end position of the line where the first annotated text is located on the second text node and the start position of the line where the second annotated text is located on the second text node.

[0135] S406, obtaining the positions of the first annotated text and the second annotated text in the target text sequence, for example, the positions include the end position of the end character of the first annotated text on the second text node and the start position of the first character of the second annotated text on the second text node.

[0136] S407: Draw a cross-line connecting line on the graphic layer according to the positions of the first annotated text and the second annotated text on the second text node and the line break position of the connecting line.

[0137] S408: Render and display a connection line between the first annotation text and the second annotation text on the graphics layer.

[0138] The above is the specific implementation process of associating two entities in the embodiment of the present invention.

[0139] Corresponding to the marking method of the embodiment of the present invention, the embodiment of the present invention provides a marking device, which uses any one of the marking components described above to perform marking. Fig. 9 FIG. 2 shows a schematic diagram of the structure of a marking device according to an embodiment of the present invention. Fig. 9 As shown, the marking device comprises:

[0140] A first display module 501 is used to display a target text sequence using the first text node, and to display each character of the target text sequence as a single HTML text node using the second text node;

[0141] An action receiving module 502 is used to receive an interactive action of a user on the target text sequence using the second text node, wherein the interactive action is used to select at least one HTML text node from the HTML text nodes of the target text sequence, and add a first DOM element to a first annotation text corresponding to the at least one HTML text node;

[0142] A first rendering module 503, configured to render the first DOM element using the tag layer;

[0143] The second display module 504 is used to display the rendered first DOM element.

[0144] In one or more embodiments of the present invention, the marking device further includes:

[0145] A second rendering module, used for rendering the graphic elements of the first annotation text using a graphic layer;

[0146] The third display module is used to display the rendered graphic elements.

[0147] In one or more embodiments of the present invention, the marking device further includes:

[0148] A detection module, configured to use the label layer to detect whether the first DOM element and the second DOM element overlap when displayed on the label layer;

[0149] a position condition module, configured to adjust the position of the first DOM element and / or the second DOM element on the label layer by using the label layer when the first DOM element overlaps with the second DOM element, so that the first DOM element and the second DOM element do not overlap when displayed on the label layer;

[0150] The second DOM element is any DOM element displayed on the tag layer.

[0151] Fig.10 A schematic diagram of the hardware structure of a labeling device provided in an embodiment of the present invention is shown.

[0152] The annotation device may include a processor 601 and a memory 602 storing computer program instructions.

[0153] Specifically, the processor 601 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiment of the present invention.

[0154] The memory 602 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 602 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 602 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 602 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 602 is a non-volatile solid-state memory. In a specific embodiment, the memory 602 includes a read-only memory (ROM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.

[0155] The processor 601 implements any one of the marking methods in the above embodiments by reading and executing computer program instructions stored in the memory 602 .

[0156] In one example, the annotation device may further include a communication interface 603 and a bus 610. Fig.10 As shown, the processor 601, the memory 602, and the communication interface 603 are connected via a bus 610 and communicate with each other.

[0157] The communication interface 603 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiment of the present invention.

[0158] Bus 610 includes hardware, software or both, and couples the components of the labeling device to each other. For example, but not limitation, the bus may include an accelerated graphics port (AGP) or other graphics bus, an enhanced industrial standard architecture (EISA) bus, a front-side bus (FSB), a hypertransport (HT) interconnect, an industrial standard architecture (ISA) bus, an infinite bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a multi-channel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable bus or a combination of two or more of these. Where appropriate, bus 610 may include one or more buses. Although the embodiments of the present invention describe and illustrate specific buses, the present invention contemplates any suitable bus or interconnect.

[0159] The marking device can execute the marking method in the embodiment of the present invention, thereby realizing the combination Figure 4 , Figure 7 , Figure 8 and Fig. 9 Described is a marking method and apparatus.

[0160] In addition, in combination with the marking method in the above embodiment, the embodiment of the present invention can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the marking methods in the above embodiment is implemented.

[0161] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0162] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0163] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.

[0164] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.

Claims

1. A labeling component, characterized in that: include: Text layer and label layer; The text layer includes: The first text node is used to display the target text sequence; as well as, The second text node is used to split each character of the target text sequence into a single Hypertext Markup Language HTML text node for display, and receive a user's interactive action; wherein the interactive action is used to select at least one HTML text node from the HTML text nodes of the target text sequence, and add a first DOM element to a first annotation text corresponding to the at least one HTML text node; The tag layer is used to render the first DOM element and display the rendered first DOM element.

2. The assembly according to claim 1, characterized in that Also includes: Graphics layer; The graphic layer is used to render the graphic elements of the first annotation text and display the rendered graphic elements.

3. The assembly according to claim 1, characterized in that The label layer is further used to detect whether the first DOM element and the second DOM element overlap when displayed on the label layer, and if the first DOM element and the second DOM element overlap, adjust the position of the first DOM element and / or the second DOM element on the label layer so that the first DOM element and the second DOM element do not overlap when displayed on the label layer; The second DOM element is any DOM element displayed on the tag layer except the first DOM element.

4. The assembly according to claim 1, characterized in that The first text node and the second text node respectively display the same content of the target text sequence, and the position of the same character in the target text sequence overlaps on the first text node and the second text node.

5. The assembly according to claim 2, characterized in that The graphic element includes at least one of the following: a background color block of the first annotation text, which is used to represent a connecting line having an associated relationship between the first annotation text and the second annotation text.

6. The assembly according to claim 1, characterized in that The first DOM element includes at least one of a DOM tag and an association relationship; Wherein, the association relationship is the association relationship between the first annotated text and the second annotated text; The second annotated text is any annotated text in the target text sequence.

7. A marking method, characterized in that: Using the marking component according to any one of claims 1 to 6 to perform marking, the method comprising: Using the first text node to display the target text sequence, and using the second text node to split each character of the target text sequence into a single HTML text node for display; Receiving a user's interactive action on the target text sequence using the second text node, wherein the interactive action is used to select at least one HTML text node from the HTML text nodes in the target text sequence, and adding a first DOM element to a first annotation text corresponding to the at least one HTML text node; The first DOM element is rendered using the tag layer, and the rendered first DOM element is displayed.

8. The method according to claim 7, characterized in that After receiving the user's interactive action on the target text sequence by using the second text node, the method further includes: The graphic element of the first annotation text is rendered using a graphic layer, and the rendered graphic element is displayed.

9. The method according to claim 7, characterized in that: Before displaying the rendered first DOM element, the method further includes: Using the label layer to detect whether the first DOM element and the second DOM element overlap when displayed on the label layer; In the case where the first DOM element overlaps with the second DOM element, adjusting the position of the first DOM element and / or the second DOM element on the label layer by using the label layer so that the first DOM element and the second DOM element do not overlap when displayed on the label layer; The second DOM element is any DOM element displayed on the tag layer.

10. A marking device, characterized in that: The marking is performed using the marking assembly according to any one of claims 1 to 6, the device comprising: A first display module, configured to display a target text sequence using the first text node, and to display each character of the target text sequence as a single HTML text node using the second text node; an action receiving module, configured to receive a user's interactive action on the target text sequence using the second text node, wherein the interactive action is used to select at least one HTML text node from the HTML text nodes in the target text sequence, and add a first DOM element to a first annotation text corresponding to the at least one HTML text node; A first rendering module, used to render the first DOM element using the tag layer; The second display module is used to display the rendered first DOM element.

11. A marking device, comprising: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the marking method according to any one of claims 7 to 9 is implemented.

12. A computer storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the marking method according to any one of claims 7 to 9.