A text annotation method and device

By obtaining and processing the focus and anchor positions of the selection, cross-row and cross-paragraph annotation is realized, and multi-layer nesting is supported, the problems of inaccurate annotation and confusing hierarchical relationships in the existing technology are solved, and the accuracy of text annotation is improved and Training efficiency of natural language processing models.

CN114282495BActive Publication Date: 2025-01-14JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011039938.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-28
Publication Date
2025-01-14
Estimated Expiration
2040-09-28

AI Technical Summary

Technical Problem

Existing text annotation tools cannot realize cross-line or cross-paragraph annotation, resulting in inaccurate results, unable to correctly identify multiple consecutive spaces, and can only perform single-layer or two-layer annotation, which cannot accurately distinguish the hierarchical relationship of text entities, and add later data Cost of correction and repair.

Method used

By obtaining the focus and anchor points of the selection, processing the relative positions of the focus and anchor points, determining the absolute position of the selection, and storing the text content and absolute position in the text tree structure, cross-row and cross-paragraph annotation, accurately identifying spaces, and supporting multiple Layer nested annotations.

Benefits of technology

It improves the accuracy of text labeling, reduces the subsequent calibration workload, provides absolute parameters of text position, facilitates accurate training of natural language processing models, and solves the problems of inaccurate annotation results and confusing hierarchical relationships in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114282495B_ABST
    Figure CN114282495B_ABST
Patent Text Reader

Abstract

The present invention discloses a text annotation method and device, and relates to the field of computer technology. A specific implementation of the method includes: in response to the selection operation of the text content in the target text, obtaining the focus, anchor point, focus relative position and anchor relative position of the selection; processing the focus relative position and anchor relative position respectively, and determining the absolute position of the selection according to the obtained focus absolute position and anchor absolute position; storing the text content in a page tag, and adding the absolute position to the attributes of the page tag, and writing the page tag to the position corresponding to the selection in the text tree structure to mark and display the text content. This implementation provides a text annotation tool that can be applied to cross-line / cross-paragraph text with spaces and carriage returns, determines the absolute position of the selection for the entire text, facilitates the subsequent NLP to accurately find the specified text content, and improves the training accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a text annotation method and device. Background Art

[0002] Natural Language Processing (NLP) is a subfield of artificial intelligence. It refers to the use of computers to process the form, sound, meaning and other information of natural language, that is, the operation and processing of the input, output, recognition, analysis, understanding and generation of characters, words, sentences, articles and chapters. It has many important impacts on the interaction between computers and humans.

[0003] Since training natural language processing models requires a large number of sample data sets, the early stage relies on manual annotation to produce high-quality training data sets. With the development of artificial intelligence natural language processing technology, the demand for manual annotation of text content is increasing. There are currently two annotation modes on the market:

[0004] 1. Text annotation client: The client software is compiled and packaged from C++ or Python, and most of them require a paid license to use. The paid version has more comprehensive functions, supports text nested annotation, relationship annotation, etc., and the formats of exported result sets are also more comprehensive, such as json, xml, csv, etc. The free version has a single function, only supports some functions such as single-layer text annotation, and the format of exported result sets is also relatively simple, which is limited in use.

[0005] 2. Online text annotation tools: Most of them are built with JavaScript and do not require local installation. Annotation can be performed using a browser, which is more flexible than text annotation clients.

[0006] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems:

[0007] 1. Due to the limitations of the logical correspondence between labels and annotated text, annotation cannot be performed across lines or paragraphs, resulting in inaccurate results and increasing the data correction work before and after annotation;

[0008] 2. Only the annotated text is extracted, but the position of the text relative to the article is not extracted. After the annotation is completed, the annotated text and the original text must be compared with the program to obtain the relative position. For annotated text that appears multiple times, serious errors will occur due to different contexts, and the cost of repairing it later is extremely high.

[0009] 3. The recognition rate of text with multiple consecutive spaces is incorrect, and the length and position of the text cannot be correctly recognized, resulting in the inability to accurately read the annotated text during training. To solve this problem, it is necessary to remove spaces before annotation and fill in spaces after annotation to correct the position, which is mechanical and repetitive. The space position is not calculated, resulting in the wrong position of the annotated text in the entire text;

[0010] 4. Only single-layer or double-layer annotation is possible, and multi-layer nested annotation is not possible. The styles of the two-layer annotation are also easily confused, and the hierarchical relationship of the text entities cannot be accurately distinguished. Summary of the invention

[0011] In view of this, an embodiment of the present invention provides a text annotation method and device, which can at least solve the problem in the prior art that it is difficult to determine the absolute position of a selected area relative to the text.

[0012] To achieve the above object, according to one aspect of an embodiment of the present invention, a text annotation method is provided, comprising:

[0013] In response to a selection operation on text content in a target text, obtaining a focus, an anchor point, a focus relative position, and an anchor point relative position of the selection;

[0014] Processing the focus relative position and the anchor point relative position respectively, and determining the absolute position of the selected area according to the obtained focus absolute position and anchor point absolute position; wherein the absolute position is the position relative to the root node in the text tree structure, and the text tree structure is constructed based on the target text;

[0015] The text content is stored in a page tag, and an absolute position is added to the attributes of the page tag. The page tag is written into a position corresponding to the selected area in the text tree structure to mark and display the text content.

[0016] Optionally, before the responding to the region selection operation on the text content in the target text, the method further includes:

[0017] In response to a selection and upload operation of the target text in the browser, displaying text content in the target text in the browser;

[0018] By regular matching, the space in the target text is replaced with the first character, the carriage return line feed is replaced with the second character, the less-than mathematical symbol is replaced with the third character, and the greater-than mathematical symbol is replaced with the fourth character.

[0019] Optionally, obtaining the focus, anchor point, focus relative position and anchor point relative position of the selected area includes:

[0020] Determine whether there is a sibling selection before the selection under the focus parent node, if so, take the position of the focus relative to the sibling selection as the focus relative position, otherwise take the position of the focus relative to the focus parent node as the focus relative position; and

[0021] It is determined whether there is a sibling selection before the selection under the anchor point parent node. If so, the position of the anchor point relative to the sibling selection is used as the anchor point relative position; otherwise, the position of the anchor point relative to the anchor point parent node is used as the anchor point relative position.

[0022] Optionally, the separately processing the focus relative position and the anchor point relative position includes:

[0023] If the relative position of the focus is the position of the focus relative to the sibling selection, then the relative position of the focus and the absolute position of the sibling selection are added to obtain the absolute position of the focus; or

[0024] If the focus relative position is the position of the focus relative to the focus parent node, then the focus relative position and the absolute position of the focus parent node are accumulated to obtain the focus absolute position; and

[0025] If the relative position of the anchor point is the position of the anchor point relative to the sibling selection, then the relative position of the anchor point and the absolute position of the sibling selection are accumulated to obtain the absolute position of the anchor point; or

[0026] If the relative position of the anchor point is the position of the anchor point relative to the parent node of the anchor point, then the relative position of the anchor point and the absolute position of the parent node of the anchor point are accumulated to obtain the absolute position of the anchor point.

[0027] Optionally, before the processing of the focus relative position and the anchor point relative position respectively, the method further includes:

[0028] Compare the focus parent node and the anchor parent node to see if they are the same, and if they are the same, determine that the text content in the selection is under the same parent node;

[0029] Traverse the object array corresponding to the parent node, and obtain the focus index value corresponding to the focus and the anchor index value corresponding to the anchor point;

[0030] If the focus index value is greater than the anchor point index value, the operation order of the selected area is determined to be reversed, and the values ​​of the focus and the anchor point as well as the values ​​of the relative position of the focus and the relative position of the anchor point are swapped.

[0031] Optionally, before processing the focus relative position and the anchor relative position respectively, the method further includes: comparing whether the focus parent node and the anchor parent node are the same, and if they are different, determining that the text content in the selected area is not under the same parent node;

[0032] Before determining the absolute position of the selected area according to the obtained absolute position of the focus and the absolute position of the anchor point, the method further includes: if the absolute position of the focus is smaller than the absolute position of the anchor point, swapping the values ​​of the focus and the anchor point as well as the values ​​of the absolute position of the focus and the absolute position of the anchor point.

[0033] Optionally, the marking and displaying the text content further includes:

[0034] Generate page content corresponding to the text content in the selected area by selecting the object's content cloning method, and determine whether the text content is the same as the page content;

[0035] If they are not the same, determining that part of the text content has been marked, determining the first selected area where the marked text content is located, and judging the overlap between the selected area and the first selected area;

[0036] If the selected areas include the first selected area, reducing the text content in the first selected area to a predetermined size; or

[0037] If the first selected area includes the selected area, reducing the text content in the selected area to a predetermined size; or

[0038] If the first selected area and the selected area are partially overlapped, the overlapping text content in the selected areas is reduced to a predetermined size.

[0039] To achieve the above object, according to another aspect of an embodiment of the present invention, a text annotation device is provided, comprising:

[0040] A selection module, configured to obtain the focus, anchor point, focus relative position and anchor point relative position of the selection in response to a selection operation on text content in a target text;

[0041] A processing module, used to process the focus relative position and the anchor relative position respectively, and determine the absolute position of the selected area according to the obtained focus absolute position and anchor absolute position; wherein the absolute position is the position relative to the root node in the text tree structure, and the text tree structure is constructed based on the target text;

[0042] The marking module is used to store the text content in a page tag, add an absolute position to the attributes of the page tag, and write the page tag into a position corresponding to the selected area in the text tree structure to mark and display the text content.

[0043] Optionally, a pre-processing module is also included for:

[0044] In response to a selection and upload operation of the target text in the browser, displaying text content in the target text in the browser;

[0045] By regular matching, the space in the target text is replaced with the first character, the carriage return line feed is replaced with the second character, the less-than mathematical symbol is replaced with the third character, and the greater-than mathematical symbol is replaced with the fourth character.

[0046] Optionally, the selection module is used to:

[0047] Determine whether there is a sibling selection before the selection under the focus parent node, if so, take the position of the focus relative to the sibling selection as the focus relative position, otherwise take the position of the focus relative to the focus parent node as the focus relative position; and

[0048] It is determined whether there is a sibling selection before the selection under the anchor point parent node. If so, the position of the anchor point relative to the sibling selection is used as the anchor point relative position; otherwise, the position of the anchor point relative to the anchor point parent node is used as the anchor point relative position.

[0049] Optionally, the processing module is used to:

[0050] If the relative position of the focus is the position of the focus relative to the sibling selection, then the relative position of the focus and the absolute position of the sibling selection are added to obtain the absolute position of the focus; or

[0051] If the focus relative position is the position of the focus relative to the focus parent node, then the focus relative position and the absolute position of the focus parent node are accumulated to obtain the focus absolute position; and

[0052] If the relative position of the anchor point is the position of the anchor point relative to the sibling selection, then the relative position of the anchor point and the absolute position of the sibling selection are accumulated to obtain the absolute position of the anchor point; or

[0053] If the relative position of the anchor point is the position of the anchor point relative to the parent node of the anchor point, then the relative position of the anchor point and the absolute position of the parent node of the anchor point are accumulated to obtain the absolute position of the anchor point.

[0054] Optionally, the system further includes a first swap module, configured to:

[0055] Compare the focus parent node and the anchor parent node to see if they are the same, and if they are the same, determine that the text content in the selection is under the same parent node;

[0056] Traverse the object array corresponding to the parent node, and obtain the focus index value corresponding to the focus and the anchor index value corresponding to the anchor point;

[0057] If the focus index value is greater than the anchor point index value, the operation order of the selected area is determined to be reversed, and the values ​​of the focus and the anchor point as well as the values ​​of the relative position of the focus and the relative position of the anchor point are swapped.

[0058] Optionally, a second switching module is further included, for:

[0059] Comparing whether the focus parent node and the anchor parent node are the same, if they are different, determining that the text content in the selected area is not under the same parent node; and

[0060] If the absolute position of the focus is smaller than the absolute position of the anchor point, the values ​​of the focus and anchor point as well as the values ​​of the absolute position of the focus and anchor point are swapped.

[0061] Optionally, the annotation module is further used to:

[0062] Generate page content corresponding to the text content in the selected area by selecting the content cloning device of the object, and determine whether the text content is the same as the page content;

[0063] If they are not the same, determining that part of the text content has been marked, determining the first selected area where the marked text content is located, and judging the overlap between the selected area and the first selected area;

[0064] If the selected areas include the first selected area, reducing the text content in the first selected area to a predetermined size; or

[0065] If the first selected area includes the selected area, reducing the text content in the selected area to a predetermined size; or

[0066] If the first selected area and the selected area are partially overlapped, the overlapping text content in the selected areas is reduced to a predetermined size.

[0067] To achieve the above objective, according to another aspect of an embodiment of the present invention, a text annotation electronic device is provided.

[0068] The electronic device of an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-mentioned text annotation methods.

[0069] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, any of the above-mentioned text annotation methods is implemented.

[0070] According to the scheme provided by the present invention, one embodiment of the above invention has the following advantages or beneficial effects: providing a text annotation tool, which can be applied to cross-line / cross-paragraph text annotation with spaces and carriage returns through symbol change preprocessing; determining the absolute position of the selected area relative to the entire text, so as to facilitate subsequent NLP to quickly and accurately find the specified text content and avoid ambiguity, thereby improving the accuracy of NLP training.

[0071] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0073] Figure 1 is a schematic diagram of the main process of a text annotation method according to an embodiment of the present invention;

[0074] FIG2( a ) is a schematic diagram of a process for determining the relative position of a focus;

[0075] FIG2( b ) is a schematic diagram of a process for determining the relative position of an anchor point;

[0076] Figure 3 A schematic diagram for calculating the absolute position of the focus point and the absolute position of the anchor point of the selection;

[0077] Figure 4 is a flowchart of an optional text annotation method according to an embodiment of the present invention;

[0078] Figure 5 is a flowchart of another optional text annotation method according to an embodiment of the present invention;

[0079] Figure 6 is a flowchart of another optional text annotation method according to an embodiment of the present invention;

[0080] Figure 7 A schematic diagram showing a selection area including a first selection area;

[0081] Figure 8 A schematic diagram showing a first selection area including a selection area;

[0082] Fig. 9 is a schematic diagram of main modules of a text annotation device according to an embodiment of the present invention;

[0083] Fig.10 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0084] Fig.11 It is a schematic diagram of the structure of a computer system of a mobile device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

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

[0086] This solution is applicable to text annotation in various languages. Taking Chinese text as an example, in terms of form, it is a string of Chinese characters (including punctuation marks, etc.), which are composed of characters, words, phrases, sentences, and then sentences are composed of paragraphs, sections, chapters, and articles. Whether in the above-mentioned various levels of characters (characters), words, phrases, sentences, paragraphs, etc., or in the transition from the next level to the next level, there are ambiguities and polysemy phenomena, that is, a string of characters with the same form can be understood as different word strings or phrase strings in different scenes or different contexts, with different meanings.

[0087] Generally speaking, most character strings can be resolved according to the corresponding context and scenario regulations, so users usually do not feel the ambiguity of natural language and can communicate correctly in natural language. However, on the one hand, in order to resolve ambiguity, a lot of knowledge is required for reasoning. How to collect and organize this knowledge more completely, how to find a suitable form to store it in the computer system, and how to effectively use knowledge to resolve ambiguity are all very labor-intensive and difficult tasks, which cannot be completed by a few people in a short period of time.

[0088] It should be noted that although this solution is applied to text annotation scenarios, its main purpose is to determine the absolute position of the selection relative to the root node of the target text, so as to provide position parameters for subsequent NLP training through the absolute position, so as to facilitate the direct picking of the corresponding text content according to the position. In addition, considering the different meanings of the same text content in different sentences, the determination of the absolute position can also eliminate ambiguity.

[0089] The following are the explanations for the rankings involved in this plan:

[0090] Window object: browser JavaScript root object.

[0091] anchorNode(aNode) object: returns the node where the selection starts.

[0092] focusNode(fNode) object: returns the node to which the selection ends.

[0093] anchorOffset (aOffset) property: Returns the number of the selection focus offset.

[0094] focusOffset (fOffset) property: Returns the number of the selection anchor point offset.

[0095] document.designMode: controls whether the entire document is editable, with values ​​of "on" and "off".

[0096] document.execCommand: Allows running commands to manipulate elements of the editable content area while the document is in editable mode.

[0097] See also Figure 1 , which shows a main flow chart of a text annotation method provided by an embodiment of the present invention, comprising the following steps:

[0098] S101: In response to a selection operation on text content in a target text, obtaining a focus, an anchor point, a relative position of the focus, and a relative position of the anchor point of the selection;

[0099] S102: Processing the focus relative position and the anchor point relative position respectively, and determining the absolute position of the selected area according to the obtained focus absolute position and anchor point absolute position; wherein the absolute position is the position relative to the root node in the text tree structure, and the text tree structure is constructed based on the target text;

[0100] S103: storing the text content in a page tag, adding an absolute position to the attributes of the page tag, and writing the page tag into a position corresponding to the selected area in the text tree structure to mark and display the text content.

[0101] In the above implementation, for step S101, the overall implementation process of this solution is based on the browser. The business personnel set up a user graphical interface for text annotation, which includes a button / option for uploading text. Clicking the button / option can upload the selected target text to the browser, and finally open and display the text content in the target text in the browser.

[0102] The target text may contain factors such as spaces, carriage returns and line feeds that affect the length and position of the subsequent recognized text. Abandoning the existing idea of ​​removing spaces before annotations and filling spaces after annotations to correct the position, this solution replaces spaces, carriage returns and line feeds through regular matching. After the replacement is completed, symbols such as spaces, carriage returns and line feeds can still be obtained normally, and the placeholder length is 1, which will not affect the length of the original text, and multiple spaces can also be recognized normally:

[0103] 1) Replace the space with the first character of HTML ";"

[0104] 2) Replace the carriage return and line feed with the second character ";;", which can be applied to cross-paragraph text annotation. This character also ensures the carriage return segmentation effect when displaying text.

[0105] In addition, during the operation, it was found that the mathematical symbols "<", ">" would conflict with the subsequent annotation results. For example, the ">" in the subsequent example 2 does not actually match. Here, > and < only represent one result set. Therefore, this solution also replaces the mathematical symbols "<", ">":

[0106] 1) Replace "<" with the third character "<;";

[0107] 2) Replace the ">" with the fourth character ">;".

[0108] The selection is created by the user dragging the mouse over the text. A text can only have one selection at a time. Use the browser's window.getSelection() method to get the Selection object in the selection:

[0109]

[0110] The Selection object mainly includes the following four:

[0111] 1) Focus Selection.anchorNode: When the user uses the mouse to select an area, the focus is the starting point recorded at the moment the mouse is pressed. When the mouse is dragged subsequently, the focus remains unchanged.

[0112] 2) Anchor point Selection.focusNode: When the user uses the mouse to select an area, the anchor point is the end point recorded when the mouse is released, and the position of the anchor point changes as the user drags the mouse.

[0113] 3) Focus relative position Selection.anchorOffset, which is the position of the focus relative to the parent node or the previous sibling selection at the same level, as shown in Figure 2(a);

[0114] 4) The relative position of the anchor point, Selection.focusOffset, is the position of the anchor point relative to the parent node or the previous sibling selection at the same level, as shown in Figure 2(b).

[0115] For step S102, what is finally recorded is the absolute position of the selected area relative to the root node in the text tree structure, including the absolute position of the focus and the absolute position of the anchor point, while the above calculations only obtain the relative position of the focus and the relative position of the anchor point, so further processing is required. Figure 3 As shown:

[0116] 1) For the absolute focus position

[0117] Determine whether the absolute focus position anchorOffset is relative to the focus parent node:

[0118] ① If not, it means there is an element of the same level, anchorNode.previousSibling. Get the absolute positioning end position in the anchorNode.previousSibling attribute (that is, the absolute position relative to the root node), and add it to anchorOffset to get the absolute starting position of the user selection;

[0119] ② If yes, get the absolute positioning starting position in the anchorNode parent node attributes, and add it to anchorOffset to get the absolute starting position of the user selection.

[0120] It should be noted that each selection area will obtain its absolute position relative to the root node when it is marked, and the brother selection area is the marked selection area, so the absolute position of the brother selection area can be directly obtained here.

[0121] 2) For the absolute position of the anchor point

[0122] Determine whether the absolute position of the anchor point, focusOffset, is relative to the parent node of the anchor point:

[0123] ① If not, it means there is a previous element of the same level, focusNode.previousSibling. Get the absolute positioning end position in the focusNode.previousSibling attribute (that is, the absolute position relative to the root node), and add it to focusOffset to get the absolute starting position of the user selection;

[0124] ② If yes, get the absolute positioning start position in the attributes of the focusNode parent node, and add it to the focusOffset to get the absolute end position of the user selection.

[0125] 3) Based on the absolute position of the focus and the absolute position of the anchor point, the absolute position of the selection relative to the root node is obtained.

[0126] For step S103, after obtaining the absolute position of the selected area through the above steps, the text content in the selected area is spliced ​​into a span tag (a tag element in the HTML language), and the absolute position is written into the attributes of the span tag.

[0127] Enable the browser's editing mode document.designMode="on", write the span tag to the position corresponding to the selected area in the text tree structure through the browser's insertion method document.execCommand, delete the original text content at this position, and then turn off the editing mode document.designMode="off". Using the document.execCommand method can effectively avoid the misalignment problem caused by cross-line annotation, and has better performance.

[0128] The text content in the selected area is marked using the technical means commonly used by those skilled in the art, such as marking color, marking annotations, etc., which will not be repeated here.

[0129] The method provided in the above embodiment provides a text annotation tool, which can be applied to cross-line / cross-paragraph text annotation with spaces and carriage returns through symbol change preprocessing; determines the absolute position of the selected area relative to the entire text, so as to facilitate subsequent NLP to quickly and accurately find the specified text content and avoid ambiguity, thereby improving the accuracy of NLP training.

[0130] See also Figure 4 , shows a schematic flow chart of an optional text annotation method according to an embodiment of the present invention, comprising the following steps:

[0131] S401: In response to a selection operation on text content in a target text, obtaining a focus, an anchor point, a focus relative position, and an anchor point relative position of the selection;

[0132] S402: comparing whether the focus parent node and the anchor parent node are the same, and if they are the same, determining that the text content in the selected area is under the same parent node;

[0133] S403: traverse the object array corresponding to the parent node, and obtain the focus index value corresponding to the focus and the anchor point index value corresponding to the anchor point;

[0134] S404: If the focus index value is greater than the anchor point index value, determining that the operation order of the selected area is reversed, and swapping the focus and anchor point values ​​as well as the focus relative position and anchor point relative position values;

[0135] S405: Processing the focus relative position and the anchor point relative position respectively, and determining the absolute position of the selected area according to the obtained focus absolute position and anchor point absolute position; wherein the absolute position is the position relative to the root node in the text tree structure, and the text tree structure is constructed based on the target text;

[0136] S406: Storing the text content in a page tag, adding an absolute position to the attributes of the page tag, and writing the page tag into a position corresponding to the selected area in the text tree structure to mark and display the text content.

[0137] In the above embodiment, for steps S401, S405 and S406, see Figure 1 The description of steps S101 to S103 is not repeated here.

[0138] For steps S402 to S404, after obtaining the Selection object, the focus parent node anchorNode.parentElement and the anchor parent node focusNode.parentElement can be determined. By comparing whether the two are the same, it is determined whether the text content selected by the user is under the same parent node. Here, the case of being under the same parent node is discussed.

[0139] The parent node has an object array parentElement.childNodes to store child nodes. By traversing parentElement.childNodes, the index value anchorIndex corresponding to the focus anchorNode and the index value focusIndex corresponding to the anchor point focusNode are obtained. In actual operation, the index value anchorIndex corresponding to the focus text node anchorNode.textContent and the index value focusIndex corresponding to the anchor point text node focusNode.textContent can be obtained.

[0140] Compare the two index values ​​anchorIndex and focusIndex to determine the selection order. If anchorIndex is smaller than focusIndex, it is selected from left to right (forward operation) and no processing is done; but if anchorIndex is larger than focusIndex, it is selected from right to left (reverse operation), and the values ​​of anchorNode and focusNode, anchorOffset and focusOffset need to be swapped to make it uniform from left to right.

[0141] The method provided in the above embodiment, for the selection of the same parent node, will determine in advance whether the focus and anchor point positions need to be swapped after obtaining the relative position of the focus and the relative position of the anchor point and before calculating the absolute position of the focus and the absolute position of the anchor point, so as to ensure the positive direction of the absolute position of the selection.

[0142] See also Figure 5, shows a schematic flow chart of another optional text annotation method according to an embodiment of the present invention, comprising the following steps:

[0143] S501: In response to a selection operation on text content in a target text, obtaining a focus, an anchor point, a relative position of the focus, and a relative position of the anchor point of the selection;

[0144] S502: comparing whether the focus parent node and the anchor parent node are the same, and if they are different, determining that the text content in the selected area is not under the same parent node;

[0145] S503: Processing the focus relative position and the anchor point relative position respectively to obtain the focus absolute position and the anchor point absolute position; wherein the absolute position is the position relative to the root node in the text tree structure, and the text tree structure is constructed based on the target text;

[0146] S504: If the absolute position of the focus is smaller than the absolute position of the anchor point, the values ​​of the focus and the anchor point as well as the values ​​of the absolute position of the focus and the absolute position of the anchor point are swapped to obtain the absolute position of the selected area;

[0147] S505: Storing the text content in a page tag, adding an absolute position to the attributes of the page tag, and writing the page tag into a position corresponding to the selected area in the text tree structure to mark and display the text content.

[0148] In the above embodiment, for steps S501 and S505, see Figure 1 The description of steps S101 and S103 is not repeated here.

[0149] For steps S502 to S504, after obtaining the Selection object, the focus parent node anchorNode.parentElement and the anchor parent node focusNode.parentElement can be determined. By comparing whether the two are the same, it is determined whether the text content selected by the user is under the same parent node. Here, the case where the text content is not under the same parent node is discussed.

[0150] 1) If anchorNode has a previous element of the same level as anchorNode.previousSibling, the absolute positioning end position in the anchorNode.previousSibling attribute is used as the reference point; if not, the absolute positioning start position in the anchorNode parent node attribute is used as the reference point. Add the reference point to anchorOffset to get the absolute focus position of the user selection.

[0151] 2) If the focusNode has a previous element of the same level as focusNode, the absolute positioning end position in the focusNode.previousSibling attribute is used as the reference point; if not, the absolute positioning start position in the focusNode parent node attribute is used as the reference point. Add the reference point to focusOffset to get the absolute position of the anchor point of the user selection.

[0152] 3) If the absolute position of the focus is greater than the absolute position of the anchor point, swap the values ​​of anchorNode and focusNode, and the absolute position of the focus and the absolute position of the anchor point.

[0153] In the method provided in the above embodiment, when the article is displayed in a certain area, it will be naturally divided into lines due to the limited display width, and each line will be used as a natural line. For cross-line / cross-paragraph selection, after obtaining the absolute position of the focus and the absolute position of the anchor point, it will be determined whether the focus and anchor point positions need to be swapped, so as to ensure the positive direction of the absolute position of the selection area.

[0154] See also Figure 6 , shows a schematic flow chart of another optional text annotation method according to an embodiment of the present invention, comprising the following steps:

[0155] S601: In response to a selection operation on text content in a target text, obtaining a focus, an anchor point, a relative position of the focus, and a relative position of the anchor point of the selection;

[0156] S602: Processing the focus relative position and the anchor point relative position respectively, and determining the absolute position of the selected area according to the obtained focus absolute position and anchor point absolute position; wherein the absolute position is the position relative to the root node in the text tree structure, and the text tree structure is constructed based on the target text;

[0157] S603: storing the text content in a page tag, adding an absolute position to an attribute of the page tag, and writing the page tag into a position corresponding to the selected area in the text tree structure;

[0158] S604: Generate page content corresponding to the text content in the selected area by using a content cloning method of the selected object, and determine whether the text content is the same as the page content;

[0159] S605: If they are not the same, determining that part of the text content has been marked, determining the first selected area where the marked text content is located, and determining the overlap between the selected area and the first selected area;

[0160] S606: If the selected areas include the first selected area, reducing the text content in the first selected area to a predetermined size;

[0161] S607: If the first selected area includes the selected area, reducing the text content in the selected area to a predetermined size;

[0162] S608: If the first selected area and the selected area are partially overlapped, reducing the overlapping text content in the selected areas to a predetermined size.

[0163] In the above embodiment, for steps S601 to S603, see Figure 1 The description of steps S101 to S103 is not repeated here.

[0164] For steps S604 to S605, there is a special case: if the content selected by the user contains previously marked content, it is a nested markup and requires special processing.

[0165] The composition of a web page is an attribute structure, starting from the root node, recursively generating child nodes downward, so the location of the selection is based on its sibling node or parent node. Since the location of the sibling node is closer to the parent node, it is necessary to first determine whether there is a marked sibling selection for the selection;

[0166] 1) Generate HTML content corresponding to the text content in the selection through the content cloning method of the Selection object (Selection.cloneContents);

[0167] 2) If the text content and the HTML content are the same, the text content in the selection is determined to be plain text content (such as example 1), and the text content contained therein has not been annotated, so it is a non-nested selection, and the normal annotation logic is executed;

[0168] Example 1:

[0169] text:Third-level subsidiary

[0170] html:Third-level subsidiary

[0171] 3) If the text content and the HTML content are different, it is determined that the text content selected by the user contains marked content (such as example 2), which is a special case of nested selection;

[0172] Example 2:

[0173] text: does not match the actual situation on site

[0174] html:with site <span id="a-4"class*_"tag tagl"data-name="{客体}"data-position="194-196"data-lvl="l"style="background-color:rgb(255,0,0);"> actual No

[0175] For steps S606 to S608, parse the HTML content, obtain the child node object array html.children in the HTML content, mark the objects in html.children as child nodes of the newly marked node, and adjust the style of the corresponding span tag.

[0176] Specifically:

[0177] 1) If the local selection contains the marked previous selection (i.e. the first selection), it means that the first selection is a child node of the current selection. To show the hierarchical nesting effect, the text content in the first selection is reduced to a certain size. See Figure 7 shown.

[0178] 2) If the first selection contains the text content in the current selection, it means that the current selection is a child node of the first selection. The text content in the current selection is reduced to a certain size. See Figure 8 shown.

[0179] 3) If only part of the content in the two selected areas overlaps, only this part of the text content can be reduced and displayed. However, in actual operation, although this situation can be achieved through code, the final display effect is not ideal (such as confusion), so the first two situations are mainly considered.

[0180] The method provided in the above embodiment can accurately distinguish the hierarchical relationship of text selections by reducing the overlapping text content, solve the existing problem of being unable to perform multi-layer nested annotation, realize flexible operation of the tool, and provide more options for data annotation.

[0181] Compared with the prior art, the text annotation tool provided by this solution has at least the following beneficial effects:

[0182] 1) Convert spaces, carriage returns and line feeds into characters to achieve cross-line and cross-paragraph text annotation, not limited to natural paragraphs of text; convert mathematical symbols that may affect subsequent annotation results into characters, which improves the accuracy of annotation results and reduces the workload of subsequent calibration;

[0183] 2) It can accurately identify spaces and the number of consecutive spaces to ensure the accuracy of text position; calculate the absolute position of the selected area, eliminate the problem of polysemy and reduce the cost of repair; provide position parameters for NLP model training, which is convenient for accurate search in the subsequent training process;

[0184] 3) Based on whether the text content in the selection is under the same parent node, different methods are used to determine whether to swap the focus position information and the anchor point position information, providing implementation diversity.

[0185] See also Fig. 9, which shows a schematic diagram of main modules of a text annotation device 900 provided in an embodiment of the present invention, including:

[0186] A selection module 901 is used to obtain the focus, anchor point, focus relative position and anchor point relative position of the selection in response to the selection operation on the text content in the target text;

[0187] Processing module 902, used to process the focus relative position and the anchor relative position respectively, and determine the absolute position of the selected area according to the obtained focus absolute position and anchor absolute position; wherein the absolute position is the position relative to the root node in the text tree structure, and the text tree structure is constructed based on the target text;

[0188] The marking module 903 is used to store the text content in a page tag, add an absolute position to the attributes of the page tag, and write the page tag into the position corresponding to the selected area in the text tree structure to mark and display the text content.

[0189] The implementation device of the present invention further includes a pre-processing module 904 (not shown in the figure), which is used to:

[0190] In response to a selection and upload operation of the target text in the browser, displaying text content in the target text in the browser;

[0191] By regular matching, the space in the target text is replaced with the first character, the carriage return line feed is replaced with the second character, the less-than mathematical symbol is replaced with the third character, and the greater-than mathematical symbol is replaced with the fourth character.

[0192] In the implementation device of the present invention, the area selection module 901 is used to:

[0193] Determine whether there is a sibling selection before the selection under the focus parent node, if so, take the position of the focus relative to the sibling selection as the focus relative position, otherwise take the position of the focus relative to the focus parent node as the focus relative position; and

[0194] It is determined whether there is a sibling selection before the selection under the anchor point parent node. If so, the position of the anchor point relative to the sibling selection is used as the anchor point relative position; otherwise, the position of the anchor point relative to the anchor point parent node is used as the anchor point relative position.

[0195] In the implementation device of the present invention, the processing module 902 is used to:

[0196] If the relative position of the focus is the position of the focus relative to the sibling selection, then the relative position of the focus and the absolute position of the sibling selection are added to obtain the absolute position of the focus; or

[0197] If the focus relative position is the position of the focus relative to the focus parent node, then the focus relative position and the absolute position of the focus parent node are accumulated to obtain the focus absolute position; and

[0198] If the relative position of the anchor point is the position of the anchor point relative to the sibling selection, then the relative position of the anchor point and the absolute position of the sibling selection are accumulated to obtain the absolute position of the anchor point; or

[0199] If the relative position of the anchor point is the position of the anchor point relative to the parent node of the anchor point, then the relative position of the anchor point and the absolute position of the parent node of the anchor point are accumulated to obtain the absolute position of the anchor point.

[0200] The implementation device of the present invention further includes a first swap module 905 (not shown in the figure), which is used to:

[0201] Compare the focus parent node and the anchor parent node to see if they are the same, and if they are the same, determine that the text content in the selection is under the same parent node;

[0202] Traverse the object array corresponding to the parent node, and obtain the focus index value corresponding to the focus and the anchor index value corresponding to the anchor point;

[0203] If the focus index value is greater than the anchor point index value, the operation order of the selected area is determined to be reversed, and the values ​​of the focus and the anchor point as well as the values ​​of the relative position of the focus and the relative position of the anchor point are swapped.

[0204] The implementation device of the present invention further includes a second swap module 906 (not shown in the figure), which is used to:

[0205] Comparing whether the focus parent node and the anchor parent node are the same, if they are different, determining that the text content in the selected area is not under the same parent node; and

[0206] If the absolute position of the focus is smaller than the absolute position of the anchor point, the values ​​of the focus and anchor point as well as the values ​​of the absolute position of the focus and anchor point are swapped.

[0207] In the implementation device of the present invention, the marking module 903 is also used for:

[0208] Generate page content corresponding to the text content in the selected area by selecting the content cloning device of the object, and determine whether the text content is the same as the page content;

[0209] If they are not the same, determining that part of the text content has been marked, determining the first selected area where the marked text content is located, and judging the overlap between the selected area and the first selected area;

[0210] If the selected areas include the first selected area, reducing the text content in the first selected area to a predetermined size; or

[0211] If the first selected area includes the selected area, reducing the text content in the selected area to a predetermined size; or

[0212] If the first selected area and the selected area are partially overlapped, the overlapping text content in the selected areas is reduced to a predetermined size.

[0213] In addition, the specific implementation content of the device described in the embodiment of the present invention has been described in detail in the method described above, so the repeated content will not be described again here.

[0214] Fig.10 An exemplary system architecture 1000 is shown in which embodiments of the present invention may be applied.

[0215] like Fig.10 As shown, the system architecture 1000 may include terminal devices 1001, 1002, 1003, a network 1004, and a server 1005 (only an example). The network 1004 is used to provide a medium for communication links between the terminal devices 1001, 1002, 1003 and the server 1005. The network 1004 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0216] The user can use the terminal devices 1001, 1002, 1003 to interact with the server 1005 through the network 1004 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 1001, 1002, 1003.

[0217] The terminal devices 1001, 1002, 1003 may be various electronic devices having display screens and supporting web browsing, and the server 1005 may be a server providing various services.

[0218] It should be noted that the method provided in the embodiment of the present invention is generally executed by the server 1005 , and accordingly, the device is generally set in the server 1005 .

[0219] It should be understood that Fig.10 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0220] Reference below Fig.11 , which shows a schematic diagram of the structure of a computer system 1100 of a terminal device suitable for implementing an embodiment of the present invention. Fig.11 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0221] like Fig.11As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage part 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the system 1100 are also stored. The CPU 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0222] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage section 1108 as needed.

[0223] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the central processing unit (CPU) 1101, the above-mentioned functions defined in the system of the present invention are executed.

[0224] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0225] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0226] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor. For example, they may be described as: a processor includes a selection module, a processing module, and a labeling module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the selection module may also be described as a "text selection module".

[0227] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0228] In response to a selection operation on text content in a target text, obtaining a focus, an anchor point, a focus relative position, and an anchor point relative position of the selection;

[0229] Processing the focus relative position and the anchor point relative position respectively, and determining the absolute position of the selected area according to the obtained focus absolute position and anchor point absolute position; wherein the absolute position is the position relative to the root node in the text tree structure, and the text tree structure is constructed based on the target text;

[0230] The text content is stored in a page tag, and an absolute position is added to the attributes of the page tag. The page tag is written into a position corresponding to the selected area in the text tree structure to mark and display the text content.

[0231] Compared with the prior art, the text annotation tool provided by this solution has at least the following beneficial effects:

[0232] 1) Convert spaces, carriage returns and line feeds into characters to achieve cross-line and cross-paragraph text annotation, not limited to natural paragraphs of text; convert mathematical symbols that may affect subsequent annotation results into characters, which improves the accuracy of annotation results and reduces the workload of subsequent calibration;

[0233] 2) It can accurately identify spaces and the number of consecutive spaces to ensure the accuracy of text position; calculate the absolute position of the selected area, eliminate the problem of polysemy and reduce the cost of repair; provide position parameters for NLP model training, which is convenient for accurate search in the subsequent training process;

[0234] 3) Based on whether the text content in the selection is under the same parent node, different methods are used to determine whether to swap the focus position information and the anchor point position information, providing implementation diversity.

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

Claims

1. A text annotation method, characterized in that: include: In response to a selection operation on text content in a target text, the focus, anchor point, focus relative position and anchor point relative position of the selection are obtained, including: determining whether there is a sibling selection located before the selection under the focus parent node, if so, taking the position of the focus relative to the sibling selection as the focus relative position, otherwise taking the position of the focus relative to the focus parent node as the focus relative position; determining whether there is a sibling selection located before the selection under the anchor point parent node, if so, taking the position of the anchor point relative to the sibling selection as the anchor point relative position, otherwise taking the position of the anchor point relative to the anchor point parent node as the anchor point relative position; Processing the focus relative position and the anchor point relative position respectively, and determining the absolute position of the selected area according to the obtained focus absolute position and anchor point absolute position; wherein the absolute position is the position relative to the root node in the text tree structure, and the text tree structure is constructed based on the target text; The text content is stored in a page tag, and an absolute position is added to the attributes of the page tag. The page tag is written into a position corresponding to the selected area in the text tree structure to mark and display the text content.

2. The method according to claim 1, characterized in that Before the region selection operation in response to the text content in the target text, the method further includes: In response to a selection and upload operation of the target text in the browser, displaying text content in the target text in the browser; By regular matching, the space in the target text is replaced with the first character, the carriage return line feed is replaced with the second character, the less-than mathematical symbol is replaced with the third character, and the greater-than mathematical symbol is replaced with the fourth character.

3. The method according to claim 1, characterized in that The processing of the focus relative position and the anchor point relative position respectively includes: If the relative position of the focus is the position of the focus relative to the sibling selection, then the relative position of the focus and the absolute position of the sibling selection are added to obtain the absolute position of the focus; or If the focus relative position is the position of the focus relative to the focus parent node, then the focus relative position and the absolute position of the focus parent node are accumulated to obtain the focus absolute position; and If the relative position of the anchor point is the position of the anchor point relative to the sibling selection, then the relative position of the anchor point and the absolute position of the sibling selection are accumulated to obtain the absolute position of the anchor point; or If the relative position of the anchor point is the position of the anchor point relative to the parent node of the anchor point, then the relative position of the anchor point and the absolute position of the parent node of the anchor point are accumulated to obtain the absolute position of the anchor point.

4. The method according to claim 3, characterized in that Before processing the focus relative position and the anchor point relative position respectively, the method further includes: Compare the focus parent node and the anchor parent node to see if they are the same, and if they are the same, determine that the text content in the selection is under the same parent node; Traverse the object array corresponding to the parent node, and obtain the focus index value corresponding to the focus and the anchor index value corresponding to the anchor point; If the focus index value is greater than the anchor point index value, the operation order of the selected area is determined to be reversed, and the values ​​of the focus and the anchor point as well as the values ​​of the relative position of the focus and the relative position of the anchor point are swapped.

5. The method according to claim 3, characterized in that: Before processing the focus relative position and the anchor relative position respectively, the method further includes: comparing whether the focus parent node and the anchor parent node are the same, and if they are different, determining that the text content in the selected area is not under the same parent node; Before determining the absolute position of the selected area according to the obtained absolute position of the focus and the absolute position of the anchor point, the method further includes: if the absolute position of the focus is smaller than the absolute position of the anchor point, swapping the values ​​of the focus and the anchor point as well as the values ​​of the absolute position of the focus and the absolute position of the anchor point.

6. The method according to claim 1, characterized in that The marking and displaying of the text content also includes: Generate page content corresponding to the text content in the selected area by selecting the object's content cloning method, and determine whether the text content is the same as the page content; If they are not the same, determining that part of the text content has been marked, determining the first selected area where the marked text content is located, and judging the overlap between the selected area and the first selected area; If the selected areas include the first selected area, reducing the text content in the first selected area to a predetermined size; or If the first selected area includes the selected area, reducing the text content in the selected area to a predetermined size; or If the first selected area and the selected area are partially overlapped, the overlapping text content in the selected areas is reduced to a predetermined size.

7. A text annotation device, characterized in that: include: A selection module, for obtaining the focus, anchor point, focus relative position and anchor point relative position of the selection in response to the selection operation of the text content in the target text, including: determining whether there is a brother selection located before the selection under the focus parent node, if so, taking the position of the focus relative to the brother selection as the focus relative position, otherwise taking the position of the focus relative to the focus parent node as the focus relative position; determining whether there is a brother selection located before the selection under the anchor point parent node, if so, taking the position of the anchor point relative to the brother selection as the anchor point relative position, otherwise taking the position of the anchor point relative to the anchor point parent node as the anchor point relative position; A processing module, used to process the focus relative position and the anchor relative position respectively, and determine the absolute position of the selected area according to the obtained focus absolute position and anchor absolute position; wherein the absolute position is the position relative to the root node in the text tree structure, and the text tree structure is constructed based on the target text; The marking module is used to store the text content in a page tag, add an absolute position to the attributes of the page tag, and write the page tag into a position corresponding to the selected area in the text tree structure to mark and display the text content.

8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Webpage instant collaborative browsing method based on DOM (document object model) and XMPP (extensible messaging and presence protocol)

    CN102637193A

  • Mobile terminal text display method, storage medium, device and system

    CN110018863A