XPath path positioning-based HTML (Hypertext Markup Language) document sentence-level intelligent labeling method and system

By using an XPath-based intelligent sentence-level annotation method for HTML documents, this method solves the problems of inaccurate positioning, low granularity, and poor security in traditional annotation methods. It achieves sentence-level fine-grained and secure annotation, improves the success rate of positioning and annotation recovery, and meets the needs of advanced natural language processing tasks.

CN121328525APending Publication Date: 2026-01-13HEFEI DAZHIHUI CAIHUI DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511461052.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-14
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Traditional data annotation methods suffer from problems such as inaccurate positioning, insufficient granularity, poor security, and weak robustness when processing dynamic and complex HTML documents, especially when it is difficult to recover annotations after changes in the HTML document structure.

Method used

We employ an intelligent sentence-level annotation method for HTML documents based on XPath path localization. Through DOMPurify purification, iframe sandbox isolation, and event interception mechanisms, combined with a joint indexing mechanism of XPath path and text summary, we achieve refined and safe sentence-level annotation.

Benefits of technology

It significantly improves positioning accuracy and stability, increasing the positioning success rate from 70% to 99.2% and the annotation recovery success rate to 97.8%. It also builds a "zero XSS, zero code injection" secure environment to meet the needs of advanced natural language processing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121328525A_ABST
    Figure CN121328525A_ABST
Patent Text Reader

Abstract

The invention discloses an XPath path positioning-based HTML (Hypertext Markup Language) document sentence-level intelligent labeling method and system, relates to the technical field of computer document processing and data labeling, constructs a'purification-sandbox-event interception 'three-layer security architecture, and provides a reliable guarantee for processing an untrusted HTML document through DOMPurity purification, iframe sandbox isolation and event interception mechanisms; sentence boundaries in the HTML document are recognized, and the labeling granularity is improved from a traditional paragraph level to a sentence level; the XPath path technology is used for HTML document sentence-level labeling and positioning, and the positioning precision and stability of labeling are improved by generating an accurate and flexible positioning expression; and a joint index mechanism of the XPath path and the text abstract is designed, so that the technical problem that the annotation is easy to lose after the document structure is changed is solved, and the annotation recovery success rate is improved. According to the method and the system, sentence-level refined and secure intelligent labeling on the HTML document is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer document processing and data annotation technology, and in particular to a method and system for intelligent sentence-level annotation of HTML documents based on XPath path location. Background Technology

[0002] Data labeling is a fundamental task in the fields of artificial intelligence and machine learning. Its purpose is to add labels or annotations to raw data (such as text, images, and audio) so that it becomes "supervised" data that can be used by algorithmic models for learning and training.

[0003] Traditional data annotation methods face problems such as inaccurate positioning, insufficient granularity, poor security, and weak robustness when processing dynamic and complex web page content. Specifically: (1) Insufficient positioning accuracy Traditional positioning methods, such as positioning based on absolute coordinates, relying on element ID identification, and simple text matching, fail to fully utilize the hierarchical structure information of HTML documents. Once the DOM structure changes, even minor modifications can cause the positioning information to become completely invalid, resulting in a large amount of duplication of annotation work and waste of resources.

[0004] (2) Coarse labeling granularity

[0005] Traditional annotation methods often use paragraphs or chapters as units, which cannot meet the needs of advanced natural language processing tasks such as named entity recognition and relation extraction that require sentence-level fine-grained annotation.

[0006] (3) Insufficient security

[0007] Traditional data annotation methods are vulnerable to XSS attacks: Directly manipulating HTML documents poses a serious risk of cross-site scripting attacks. Attackers can embed malicious JavaScript code in HTML documents. When annotators open an HTML document containing malicious code, these scripts will execute in the context of the annotation system, potentially stealing sensitive information or tampering with page content.

[0008] (4) Poor recovery ability

[0009] Due to the fragility of traditional localization methods, once the DOM structure of an HTML document changes, the original localization information becomes invalid, leading to lost or misaligned annotations. This makes long-term maintenance and updating of dynamically changing datasets extremely difficult. Statistics show that the success rate of annotation recovery after document structure changes using traditional data annotation methods is less than 30%. Summary of the Invention

[0010] To overcome the shortcomings of the prior art, this invention provides a method and system for intelligent sentence-level annotation of HTML documents based on XPath path localization, enabling refined and secure intelligent annotation of HTML documents at the sentence level.

[0011] To achieve the above objectives, the present invention adopts the following technical solution, including: A sentence-level intelligent annotation method for HTML documents based on XPath path localization, including the following: S1, Document secure loading phase: Perform DOMPurify cleansing on the HTML document; load the cleaned HTML document into the iframe sandbox; set up an event interception mechanism for the iframe sandbox; S2, Annotation environment initialization phase: After the HTML document is parsed, a DOM tree is formed. The DOM tree is traversed to find annotable elements and add tags to the annotable elements. S3, Interactive annotation stage: Add annotation tags to sentence elements in an HTML document, generate a unique location identifier (XPath path) for the sentence element, and save the annotation data to a database; The annotation data includes annotation labels, sentence elements, and XPath paths; S4, Annotation restoration display stage: First, the stored XPath path is used for location. If the XPath path of the target element is invalid, fault tolerance recovery is initiated. Candidate elements that match the text digest of the target element are searched in the vicinity of the target element. The target element is then deduced from the text digest of the target element and its XPath path is updated.

[0012] Preferably, the specific process of step S3 is as follows: S31, the user selects the label to be used from the label library; S32, The user clicks on the sentence element to be annotated in the HTML document; S33 generates a unique location identifier, i.e., an XPath path, for the clicked sentence element; S34, package the annotation information into annotation data; S35, save the labeled data to the database for storage; S36 adds color markers and annotation labels to annotated sentence elements on the page to provide visual feedback.

[0013] Preferably, in step S4, the contextual content at the same level as the target element is extracted to generate a text summary of the target element, specifically in the following manner: Get the parent node of the target element; Iterate through all child elements under the parent node; Find the position of the target element in the list of child elements; Extract the content of the preceding element of the target element; Extract the content of the element following the target element; The target element content, the preceding element content, the following element content, and the target element's XPath path are combined to generate combined data. The combined data is then processed by a summarization algorithm to generate a text summary, which is then stored. If the HTML document changes or the XPath path in the stored annotation data cannot be restored, the target element is deduced from the text summary and the XPath path is updated. Specifically, the text summary is processed by a summary algorithm to obtain combined data, and the combined data is split to obtain the context content, thereby updating the XPath path of the target element.

[0014] Preferably, if the preceding or following element does not exist, a degradation strategy is enabled to extract the parent element and generate combined data based on the parent element.

[0015] The preferred method for identifying sentence boundaries is as follows: Scan HTML documents and identify areas containing text content; Filter out meaningless content and retain valid text information; The start and end positions of each semantic unit serve as the sentence boundary, and the start position of the sentence is the XPath path of the sentence element.

[0016] This invention also provides an intelligent sentence-level annotation system for HTML documents based on XPath path localization, applicable to the aforementioned intelligent sentence-level annotation method for HTML documents based on XPath path localization. The system includes: Secure document processing module: Used to perform document security processing on HTML documents, including DOMPurify purification of HTML documents, loading the purified HTML documents into the iframe sandbox, and setting up an event interception mechanism for the iframe sandbox; Sentence-level annotation engine: used to identify and annotate sentence boundaries in HTML documents; XPath path location module: used to generate unique location identifiers for elements; Annotation data management module: used for storing, retrieving, and restoring annotation data.

[0017] The present invention also provides a readable storage medium having a computer program stored thereon, wherein the computer program, when executed, implements the aforementioned intelligent annotation method for HTML documents at the sentence level based on XPath path localization.

[0018] The present invention also provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the aforementioned intelligent annotation method for HTML document sentence level based on XPath path localization.

[0019] The present invention also provides a computer program product comprising a computer program / instruction that, when executed by a processor, implements the aforementioned intelligent annotation method for HTML document sentence-level annotation based on XPath path localization.

[0020] The advantages of this invention are: (1) This invention focuses on the method and system implementation of sentence-level fine-grained, secure, and intelligent annotation of HTML documents, aiming to solve the problems of inaccurate positioning, low granularity, poor security, and weak robustness faced by traditional data annotation methods when processing dynamic and complex web page content. Among them, sentence-level fine-grained annotation refers to: achieving accurate annotation of individual sentences to meet the needs of advanced natural language processing tasks. Secure annotation refers to: constructing a multi-layered security architecture to effectively prevent XSS attacks and malicious code execution. Intelligent annotation refers to: providing a complete system implementation scheme to ensure the practicality and operability of the technology.

[0021] (2) This invention is the first to use XPath path technology for sentence-level annotation and positioning in HTML documents. By generating accurate and flexible positioning expressions, the positioning success rate is increased from about 70% of the traditional method to 99.2%, which significantly improves the positioning accuracy and stability of the annotation.

[0022] (3) The present invention constructs a three-layer security architecture of "purification-sandbox-event interception". Through DOMPurify purification, iframe sandbox isolation and event interception mechanism, it achieves the security goal of "zero XSS and zero code injection" and provides reliable protection for handling untrusted HTML documents.

[0023] (4) The present invention designs an XPath + text summary joint indexing mechanism, which improves the annotation recovery success rate to 97.8% through dual protection of structural path and content fingerprint, and solves the technical problem of annotation loss after document structure changes.

[0024] (5) This invention proposes an innovative sentence-level annotation engine that can intelligently identify sentence boundaries in HTML documents, realize fine-grained data annotation and batch management, and improve the annotation granularity from the traditional paragraph level to the sentence level, which greatly enhances the semantic value of the annotated data. Attached Figure Description

[0025] Figure 1This is a flowchart of a sentence-level intelligent annotation method for HTML documents based on XPath path localization.

[0026] Figure 2 This is a schematic diagram of an HTML document sentence-level intelligent annotation system based on XPath path localization. Detailed Implementation

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] The technical terms used in this invention are explained as follows: XPath (XML Path Language) is a language used to locate elements in HTML documents, and is commonly used in scenarios such as data extraction and web page parsing.

[0029] The DOM (Document Object Model Tree) is a tree-like structure representation of an HTML document formed by a browser after parsing it. It treats all elements, attributes, and text in the document as nodes and organizes them according to a hierarchical relationship, making it easier for programs (such as JavaScript) to access and manipulate the document content.

[0030] DOMPurify is a JavaScript library for cleaning up HTML documents and preventing XSS (Cross-Site Scripting) attacks. It can identify and remove malicious code from HTML documents while preserving safe content and structure, and is often used to process HTML documents with user input.

[0031] The iframe sandbox is an HTML element that... <iframe>A security feature introduced by an element to restrict the permissions of embedded external content (such as third-party web pages, user-submitted HTML) and prevent it from performing malicious operations is one of the core means to prevent security risks such as XSS attacks and data leaks. The iframe sandbox is enabled through the sandbox attribute of the <iframe> tag.

[0032] Example 1As shown in Figure 1, a sentence-level intelligent annotation method for HTML documents based on XPath path positioning of the present invention includes the following steps: S1. Document security loading stage, specifically as follows: S11. DOMPurify purification: Use a recognized security library in the industry to completely remove dangerous elements and attributes in the HTML document and clear XSS attack code from the source; S12. iframe sandbox loading: Load the purified HTML document into an iframe sandbox with the sandbox attribute set to create an isolated sandbox environment; S13. Event interception mechanism: Listen for and block dangerous events in the iframe sandbox, such as script execution, form submission, etc., to add an additional security line of defense.

[0033] S2. Annotation environment initialization stage, specifically as follows: Scan annotatable elements: After the HTML document is parsed to form a DOM tree, traverse the DOM tree to find all common text container tags, such as , , , etc., and add the class="annotatable" identifier to these elements.

[0034] The code example for adding an identifier to an annotatable element is as follows: document.querySelectorAll('p,span,div').forEach(el =>{ if(el.textContent.trim()) el.classList.add('annotatable');}).

[0035] Select appropriate elements according to the semantic and layout requirements of the content. Use to display article paragraphs, to divide page blocks and combine multiple elements, and to adjust local text styles and group inline elements.

[0036] This invention accurately identifies sentence boundaries by parsing the DOM tree and text content, as follows: (1) Document structure analysis: Scan the HTML document and identify areas containing text content (such as paragraphs, headings, list items, etc.). (2) Text content filtering: Filter out meaningless content such as blanks and special symbols, and retain valid text information; (3) Boundary determination: The start and end positions of each semantic unit constitute the boundary range of the annotation (the start position is the XPath path, and each HTML element has its own unique XPath).

[0037] S3, interactive annotation stage, as follows: S31, the user selects the label to be used (such as "person's name", "place name" etc.) from the label library provided by the system. S32, the user clicks on the text content (sentence element) to be annotated in the displayed HTML document; S33, the system generates a unique location identifier (XPath path) for the clicked sentence element. S34, the system packages the annotation information (including label type, text content, location information, etc.) into data records; S35, the system saves the complete annotation data to the database for persistent storage; S36, the system adds color markers and labels to the marked text content on the page to provide visual feedback.

[0038] The data storage structure for the labeled data stored in the database is shown below: { "Annotation Record ID": "annot_001", "Label Name": "Person's Name", "Unique identifier for the label": "person_label_guid", "Annotated text content": "Zhang San", "Text location identifier (XPath path)": " / / div[@class='content'] / p[3]", "Text content fingerprint": "a1b2c3d4e5f6", Dataset ID: 123 Project Number: 456 Creation time: 1698765432} S4, the stage of restoring the display of annotations, is as follows: A combined "XPath + text digest" recovery mechanism is adopted. First, the stored XPath path is used for precise positioning. If the XPath path becomes invalid due to changes in the DOM structure, the system initiates a fault-tolerant recovery process, searching for candidate elements that match the text digest of the target element in the vicinity of the target element, thus achieving a high success rate of annotation recovery.

[0039] The specific process of extracting the contextual content of the target element at the same level and generating a text summary of the target element is as follows: (1) Get the parent node of the target element; (2) Traverse all child elements under the parent node; (3) Find the position of the target element in the list of child elements; (4) Extract the content of the preceding element of the target element; (5) Extract the content of the element following the target element; (6) Combine the content of the target element, the content of the preceding element, the content of the following element, and the XPath path of the target element to generate combined data. Then, perform a summarization algorithm on the combined data to generate a text summary and store it.

[0040] If the preceding or following element does not exist, a degradation strategy is enabled to extract the parent element and generate combined data based on the parent element.

[0041] Example: Technology News Today's top news summary Renowned scientist Zhang San delivers a speech at Peking University This speech attracted a large audience. We will continue to follow up on related reports. Step 1: Identify the DOM position of the target element (i.e., the text element annotated by the user).

[0042] Target element: The third p tag, containing 'Zhang San'; XPath path: / / div[@class='article'] / p[3].

[0043] Step 2: Extracting the context of sibling elements.

[0044] Previous sibling element: Today's top news summary ; Next sibling element: This speech attracted a large audience. .

[0045] Step 3: Data combination and text summary generation.

[0046] Combine the content of the target element, the content of the preceding element, the content of the following element, and the XPath path of the target element to generate combined data; specific example: "Zhang San | Today's News Overview | This speech attracted many listeners | / / div[@class='content'] / p[3]"; Then, this combined data is processed (encrypted) using MD5 (Message-Digest Algorithm 5) to generate a text digest: a7b8c9d4e5f6789012345678901234ab.

[0047] The above text summary is stored. If the HTML document changes or the XPath path in the originally stored annotation data cannot be restored, then the target element is deduced using this text summary, and the XPath path of the target element is updated. Specifically, the text summary is decrypted to obtain combined data, and the combined data is split to obtain the context content, thereby updating the XPath path of the target element.

[0048] This invention improves positioning accuracy and stability by introducing XPath path positioning technology to build a more robust and accurate positioning mechanism. This invention achieves sentence-level fine-grained annotation, designs a sentence-level annotation engine, intelligently parses the DOM tree and text content, accurately identifies sentence boundaries, and meets the needs of advanced NLP tasks. This invention can prevent security risks such as XSS, build a "zero-trust" annotation environment, and ensure system security when processing HTML documents containing malicious code through a multi-layered security architecture. This invention can accurately recover annotations after document structure changes by designing an "XPath + text summary" joint indexing mechanism, improving the annotation recovery success rate.

[0049] Experimental verification shows that, The positioning accuracy of this invention is significantly improved. Through XPath path positioning technology, the positioning success rate is increased from 70% of the traditional method to 99.2%, which greatly improves the efficiency and accuracy of annotation work and reduces repetitive work caused by positioning failure.

[0050] The annotation granularity of the present invention is finely upgraded, from the traditional paragraph-level annotation to sentence-level fine-grained annotation, which meets the needs of advanced natural language processing tasks such as named entity recognition, relation extraction, and event detection, and enhances the application value of the annotation data.

[0051] The present invention has excellent security performance. After 48 hours of professional penetration testing, it achieves the security goal of "zero XSS and zero code injection", providing users with a safe and reliable annotation environment and eliminating security concerns about processing untrusted HTML documents.

[0052] The recovery ability of the present invention is powerful, and the success rate of annotation recovery reaches 97.8%. Even after the structure of the source document changes, most of the existing annotation results can still be accurately recovered, greatly reducing the maintenance cost and the workload of repeated annotation.

[0053] The present invention has strong concurrent processing ability, supports more than 50 users to annotate simultaneously, and meets the requirements of enterprise-level applications. The front-end and back-end separation architecture and optimized database design ensure the stability and response speed of the system in high-concurrency scenarios.

[0054] Embodiment 2As shown in Figure 2, an HTML document sentence-level intelligent annotation system based on XPath path positioning of the present invention is applicable to the method of Embodiment 1 above. The system includes:A secure document processing module: used to perform document security processing on the HTML document, including purifying the HTML document with DOMPurify, loading the purified HTML document into an iframe sandbox, and setting an event interception mechanism for the iframe sandbox;A sentence-level annotation engine: used to identify the sentence boundaries in the HTML document and perform annotations;An XPath path positioning module: used to generate a unique position identifier for the element, that is, an XPath path expression;An annotation data management module: used to store, retrieve, and recover annotation data.

[0055] Embodiment 3An electronic device includes a processor, a memory, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method of Embodiment 1 above is implemented.

[0056] The electronic device in the embodiment of the present application can be the mobile device itself or a stand-alone device independent of it. The stand-alone device can communicate with the mobile device to receive the input signals collected from them and send the selected target decision-making behaviors to it.

[0057] The electronic device includes one or more processors and a memory. The processor can be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and can control other components in the electronic device to perform the desired functions. The memory can include one or more computer program products, and the computer program products can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory.The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the decision-making behavior and decision-making method of the various embodiments of this application described above, and / or other desired functions.

[0058] Electronic devices may also include input devices and output devices.

[0059] Example 4 In addition to the methods and devices described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the decision-making behavior decision-making method according to various embodiments of this application as described in Embodiment 1 above.

[0060] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this application. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0061] Example 5 Embodiments of this application may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the decision-making behavior decision-making method according to various embodiments of this application described in Embodiment 1 above.

[0062] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0063] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.< / iframe>

Claims

1. A sentence-level intelligent annotation method for HTML documents based on XPath path localization, characterized in that, Includes the following: S1, Document secure loading phase: Perform DOMPurify purification on the HTML document; load the purified HTML document into the iframe sandbox; Configure an event interception mechanism for the iframe sandbox; S2, Annotation environment initialization phase: After the HTML document is parsed, a DOM tree is formed. The DOM tree is traversed to find annotable elements and add tags to the annotable elements. S3, Interactive annotation stage: Add annotation tags to sentence elements in an HTML document, generate a unique location identifier (XPath path) for the sentence element, and save the annotation data to a database; The annotation data includes annotation labels, sentence elements, and XPath paths; S4, Annotation restoration display stage: First, the stored XPath path is used for location. If the XPath path of the target element is invalid, fault tolerance recovery is initiated. Candidate elements that match the text digest of the target element are searched in the vicinity of the target element. The target element is then deduced from the text digest of the target element and its XPath path is updated.

2. The HTML document sentence-level intelligent annotation method based on XPath path localization according to claim 1, characterized in that, The specific process of step S3 is as follows: S31, the user selects the label to be used from the label library; S32, The user clicks on the sentence element to be annotated in the HTML document; S33 generates a unique location identifier, i.e., an XPath path, for the clicked sentence element; S34, package the annotation information into annotation data; S35, save the labeled data to the database for storage; S36 adds color markers and annotation labels to annotated sentence elements on the page to provide visual feedback.

3. The HTML document sentence-level intelligent annotation method based on XPath path localization according to claim 1, characterized in that, In step S4, the contextual content at the same level as the target element is extracted to generate a text summary of the target element. Specifically, the method is as follows: Get the parent node of the target element; Iterate through all child elements under the parent node; Find the position of the target element in the list of child elements; Extract the content of the preceding element of the target element; Extract the content of the element following the target element; The target element content, the preceding element content, the following element content, and the target element's XPath path are combined to generate combined data. The combined data is then processed by a summarization algorithm to generate a text summary, which is then stored. If the HTML document changes or the XPath path in the stored annotation data cannot be restored, the target element is deduced from the text summary and the XPath path is updated. Specifically, the text summary is processed by a summary algorithm to obtain combined data, and the combined data is split to obtain the context content, thereby updating the XPath path of the target element.

4. In the HTML document sentence-level intelligent annotation method based on XPath path positioning according to claim 3, if the preceding or following element does not exist, a degradation strategy is enabled to extract the parent element and generate combined data based on the parent element.

5. The HTML document sentence-level intelligent annotation method based on XPath path localization according to claim 1, characterized in that, The method for identifying sentence boundaries is as follows: Scan HTML documents and identify areas containing text content; Filter out meaningless content and retain valid text information; The start and end positions of each semantic unit serve as the sentence boundary, and the start position of the sentence is the XPath path of the sentence element.

6. An intelligent sentence-level annotation system for HTML documents based on XPath path localization, characterized in that, The system, applicable to the HTML document sentence-level intelligent annotation method based on XPath path localization as described in any one of claims 1-5, comprises: Secure document processing module: Used to perform document security processing on HTML documents, including DOMPurify purification of HTML documents, loading the purified HTML documents into the iframe sandbox, and setting up an event interception mechanism for the iframe sandbox; Sentence-level annotation engine: used to identify and annotate sentence boundaries in HTML documents; XPath path location module: used to generate unique location identifiers for elements; Annotation data management module: used for storing, retrieving, and restoring annotation data.

7. A readable storage medium, characterized in that, It stores a computer program, which, when executed, implements the HTML document sentence-level intelligent annotation method based on XPath path localization as described in any one of claims 1-5.

8. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the HTML document sentence-level intelligent annotation method based on XPath path positioning as described in any one of claims 1-5.

9. A computer program product, characterized in that, It includes a computer program / instruction that, when executed by a processor, implements the HTML document sentence-level intelligent annotation method based on XPath path localization as described in any one of claims 1-5.