Text processing method and device, electronic equipment, storage medium and program product

By converting text documents into web page files and constructing a hierarchical mapping relationship between title items, the problem of low efficiency in text document segmentation is solved, automated and efficient segmentation is achieved, and the segmentation process is simplified.

CN120688450APending Publication Date: 2025-09-23MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510251716.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In the prior art, the segmentation process of text documents relies on a directory tree, which results in low segmentation efficiency and takes up a lot of computing time.

Method used

Convert the text document into a web page file, and build a mapping relationship between title items and hierarchies based on the directory of the text document. Group the tags in the web page file through the mapping relationship to obtain tag groups, and then segment the text document.

Benefits of technology

Through the automated tag grouping process, the segmentation efficiency of text documents is improved, the complexity of segmentation is reduced, logically related content is segmented, and the tedious work of manual tagging and classification is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120688450A_ABST
    Figure CN120688450A_ABST
Patent Text Reader

Abstract

The invention provides a text processing method and device, electronic equipment, a storage medium and a program product. The method comprises the steps that a text document is converted into a webpage file, the webpage file comprises first labels, and the first labels are in one-to-one correspondence with texts in the text document; based on the catalog of the text document, constructing a mapping relationship between the title items in the catalog and the levels of the title items; based on the mapping relation, grouping the first labels to obtain a plurality of label groups; and segmenting the text document based on the tag group to obtain a plurality of sub-texts. Through the method and the device, the segmentation efficiency of the text document can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a text processing method, device, electronic device, storage medium, and program product. Background Art

[0002] Summarizing the knowledge in a text document can help users quickly understand and learn key content, thereby maintaining their knowledge. Because documents are large, often spanning dozens or even dozens of pages, summarizing them requires segmenting them. When reviewing a document, the summary should be displayed on one side, with the corresponding segment of the summary marked, making it easier to review the summary while reading the document. Summary of the Invention

[0003] The embodiments of the present application provide a text processing method, device, electronic device, computer-readable storage medium and computer program product, which can effectively improve the segmentation efficiency of text documents.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present invention provides a method for processing text, including:

[0006] Converting the text document into a web page file, wherein the web page file includes a first tag, and the first tag corresponds to the text in the text document in a one-to-one manner;

[0007] Based on the directory of the text document, constructing a mapping relationship between title items in the directory and the hierarchies of the title items;

[0008] Based on the mapping relationship, grouping the first tags in the web page file to obtain multiple tag groups;

[0009] The text document is segmented based on the tag group to obtain a plurality of sub-texts.

[0010] The present invention provides a method for processing text, including:

[0011] In response to the segmentation instruction for the text document, sending a segmentation request for the text;

[0012] receiving a plurality of subtexts of the text document returned in response to the segmentation request, wherein the subtexts are obtained by segmenting the text document based on the tag groups;

[0013] The tag group is obtained by grouping the first tags in the web page file of the text document based on a mapping relationship, and the mapping relationship is obtained based on the title items and the hierarchy of the title items in the directory of the text document.

[0014] An embodiment of the present application provides an electronic device, including:

[0015] a memory for storing computer-executable instructions or computer programs;

[0016] The processor is used to implement the text processing method provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.

[0017] An embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions for causing a processor to execute the instructions to implement the text processing method provided in the embodiment of the present application.

[0018] The present invention provides a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the text processing method described in the present invention.

[0019] The embodiments of the present application have the following beneficial effects:

[0020] The text document is converted into a web page file, the web page file includes a first tag, and based on the directory of the text document, a mapping relationship between the title items in the directory and the hierarchy of the title items is constructed. Based on the mapping relationship, the first tag is grouped to obtain a tag group, and the text document is segmented based on the tag group to obtain multiple sub-texts. In this way, the text document is converted into a web page file containing the first tag, and a structural identifier is given to the text. This automated conversion process avoids the tedious work of manual labeling and classification. By constructing a mapping relationship between the title items in the directory and the hierarchy of the title items based on the directory of the text document, and constructing a mapping relationship between the title items in the directory and their hierarchy, a clear structural framework is provided for the segmentation of the text. Segmentation can be performed directly based on the hierarchical structure of the directory, reducing the complexity of segmentation, thereby simplifying the processing process through the mapping relationship. Based on the mapping relationship, the first tags are grouped to obtain tag groups. By grouping the first tags based on the mapping relationship, the content can be divided into logically related tag groups, because the segmentation work can be concentrated on the tag groups with similar content rather than the entire document, thereby improving the segmentation efficiency. The text document is segmented based on the tag group to obtain multiple sub-texts, and the text corresponding to the first tag in the tag group is used for segmentation, which realizes the automation of the segmentation process and does not require the directory tree of the text document to implement segmentation, thereby effectively improving the segmentation efficiency of the text document. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 Schematic diagram of the structure of the text processing system provided in the embodiment of the present application;

[0022] Figure 2 This is a schematic diagram of the structure of an electronic device for processing text provided in an embodiment of the present application. Figure 1 ;

[0023] Figure 3 This is a schematic diagram of the structure of an electronic device for processing text provided in an embodiment of the present application. Figure 2 ;

[0024] Figure 4 This is a flowchart of the text processing method provided in the embodiment of the present application. Figure 1 ;

[0025] Figure 5 This is a flowchart of the text processing method provided in the embodiment of the present application. Figure 2 ;

[0026] Figure 6 This is a schematic diagram of the principle of the web page file provided by the embodiment of the present application;

[0027] Figure 7 This is a schematic diagram of the principle of establishing a mapping relationship provided in an embodiment of the present application;

[0028] Figure 8 This is a schematic diagram of the principle of the text processing method provided in the embodiment of the present application. Figure 1 ;

[0029] Figure 9 This is a flowchart of the text processing method provided in the embodiment of the present application. Figure 3 ;

[0030] Figure 10 This is a flowchart of the text processing method provided in the embodiment of the present application. Figure 4 ;

[0031] Figure 11 This is a schematic diagram of the principle of the text processing method provided in the embodiment of the present application. Figure 2 ;

[0032] Figure 12 It is a schematic diagram showing the effect of the text processing method provided in the embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0034] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0035] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0036] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0037] Before further explaining the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0038] 1) Text Document: A text document is a file containing text, typically stored using a simple character encoding such as ASCII or Unicode. The content of a text document can be any form of textual information, such as novels, articles, program code, or data. A text document does not contain formatting information, so its appearance (such as font, color, size, etc.) is determined by the application used to view it (such as a text editor or web browser). The core of a text document is text, a string of letters, numbers, punctuation marks, and special characters. These characters are arranged in a specific order to form various types of information, such as articles, reports, and notes. Text documents do not rely on any specific font or format; they only use basic character encodings such as ASCII or UTF-8 to store information. This means that the content and order of the document should be the same regardless of whether it is opened on a system that supports the corresponding encoding.

[0039] 2) Web Page File (HTML File): Also known as Hypertext Markup Language File, a web page file is a special text file that uses Hypertext Markup Language (HTML) to format and present content. HTML files can contain not only text, but also images, links, multimedia content, etc. When a web page file is opened in a web browser, the browser will interpret the HTML tags and render the web page according to the instructions of these tags. Hypertext Markup Language (HTML) is a markup language that includes a series of tags that can unify the format of documents on the Internet and connect scattered Internet resources into a logical whole. HTML text is a descriptive text composed of HTML commands. HTML commands can describe text, graphics, animation, sound, tables, links, etc.

[0040] 3) HTML Tag: The HTML tag includes the first and second tags described above. It is the basic building block of HTML language and is used to define the structure and format of the web page content. Each HTML tag has a start tag and an end tag, such as Indicates a paragraph, Indicates a link, Represents an image. The web page tag can contain attributes that provide additional information about the element, such as the href attribute that defines the target of a link.

[0041] During the implementation of the embodiments of this application, the applicant discovered that the related technology has the following problems:

[0042] In the related art, text document segmentation is usually achieved through the directory tree of the text document. However, since the construction of the target tree of the text document and the target tree segmentation process take up a lot of computing time, the segmentation efficiency in the related art is low.

[0043] Embodiments of the present application provide a text processing method, device, electronic device, computer-readable storage medium, and computer program product, which can effectively improve the segmentation efficiency of text documents. The following describes an exemplary application of the text document segmentation system provided by the embodiments of the present application.

[0044] See also Figure 1 , Figure 1 It is a schematic diagram of the architecture of the text processing system 100 provided in an embodiment of the present application. The terminal (terminal 400 is shown as an example) is connected to the server 200 via the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0045] The terminal 400 is used for the user to use the client 410 to display subtext on a graphical interface 410-1 (graphic interface 410-1 is shown as an example). The terminal 400 and the server 200 are connected to each other via a wired or wireless network.

[0046] In some embodiments, the server 200 can be an independent physical server, or a server cluster or business system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 400 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart TV, a smart watch, a car terminal, etc., but is not limited to this. The electronic device provided in the embodiment of the present application can be implemented as a terminal or as a server. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present application.

[0047] In some embodiments, the server 200 converts a text document into a web page file, and based on the directory of the text document, constructs a mapping relationship between the title items in the directory and the hierarchy of the title items, and based on the mapping relationship, groups the first tags to obtain a tag group; and segments the text document based on the tag group to obtain multiple sub-texts.

[0048] In other embodiments, the terminal 400 converts the text document into a web page file, and based on the directory of the text document, constructs a mapping relationship between the title items in the directory and the hierarchy of the title items, and sends the mapping relationship to the server 200. The server 200 groups the first tags based on the mapping relationship to obtain a tag group; and segments the text document based on the tag group to obtain multiple sub-texts.

[0049] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of an electronic device for processing text provided in an embodiment of the present application. Figure 1 ,in, Figure 2 The electronic device 500 shown may be Figure 1 The server 200 or the terminal 400 in Figure 2 The electronic device 500 shown includes: at least one processor 430, a memory 450, and at least one network interface 420. The various components in the electronic device 500 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 2 Various buses are labeled as bus system 440 .

[0050] The processor 430 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0051] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 430.

[0052] The memory 450 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0053] In some embodiments, the memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.

[0054] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, and driver layer, which are used to implement various basic services and process hardware-based tasks;

[0055] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB).

[0056] In some embodiments, the text processing device provided in the embodiments of the present application can be implemented in software. Figure 2 A text processing device 455 stored in memory 450 is shown. This device can be software in the form of a program or plug-in, and includes the following software modules: a conversion module 4551, a construction module 4552, a grouping module 4553, and a segmentation module 4554. These modules are logical and can be arbitrarily combined or further divided according to the functions they implement. The functions of each module will be described below.

[0057] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device for processing text provided in an embodiment of the present application. Figure 2 ,in, Figure 3 The electronic device 600 shown may be Figure 1 The server 200 or the terminal 400 in Figure 3 The electronic device 600 shown includes: at least one processor 530, a memory 550, and at least one network interface 520. The various components in the electronic device 600 are coupled together via a bus system 540. It is understood that the bus system 540 is used to achieve connection and communication between these components. In addition to including a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 540 is not described in detail. Figure 3 Various buses are labeled as bus system 540 .

[0058] The processor 530 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0059] The memory 550 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 550 may optionally include one or more storage devices that are physically remote from the processor 530.

[0060] The memory 550 includes volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.

[0061] In some embodiments, the memory 550 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplified below.

[0062] Operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0063] The network communication module 552 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 520. Exemplary network interfaces 520 include Bluetooth, Wireless Fidelity (WiFi), and Universal Serial Bus (USB).

[0064] In some embodiments, the text processing device provided in the embodiments of the present application can be implemented in software. Figure 3 A text processing device 555 stored in memory 550 is shown. This device can be software in the form of a program or plug-in, and includes the following software modules: a sending module 5551 and a receiving module 5552. These modules are logical and can be arbitrarily combined or further separated according to the functions they implement. The functions of each module will be described below.

[0065] In other embodiments, the text processing device provided in the embodiments of the present application can be implemented in hardware. As an example, the text processing device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the text processing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0066] In some embodiments, the terminal or server can implement the text processing method provided in the embodiments of the present application by running a computer program or computer executable instructions. For example, the computer program can be a native program (e.g., a dedicated segmentation program) or a software module in the operating system, for example, a segmentation module that can be embedded in any program (such as an instant messaging client, a photo album program, an electronic map client, a navigation client); for example, it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run. In short, the above-mentioned computer program can be any form of application, module or plug-in.

[0067] The text processing method provided in the embodiments of the present application will be explained in combination with the exemplary application and implementation of the server or terminal provided in the embodiments of the present application.

[0068] See also Figure 4 , Figure 4 This is a flowchart of the text processing method provided in the embodiment of the present application. Figure 1 , will combine Figure 4 Steps 101 to 104 are shown for illustration. The text processing method provided in the embodiment of the present application can be implemented by the server or the terminal alone, or by the server and the terminal in collaboration. The following will be illustrated by taking the server alone as an example.

[0069] In step 101, the text document is converted into a web page file.

[0070] In some embodiments, the web page file includes a first tag, and the first tag corresponds one-to-one with the text in the text document.

[0071] In some embodiments, a text document is a file containing text, which is typically stored using a simple character encoding (such as ASCII or Unicode). The content of a text document can be any form of text information, such as novels, articles, program code, data, etc. A text document does not contain formatting information, so its appearance (such as font, color, size, etc.) is determined by the application that views it (such as a text editor, web browser, etc.) when it is opened. The core of a text document is text, which is a string of letters, numbers, punctuation marks, and special characters. These characters are arranged in a certain order to form various information such as articles, reports, notes, etc. A text document does not rely on any specific font or format, it only uses basic character encoding to store information, such as ASCII or UTF-8, which means that the content and order of the document should be the same no matter which system supports the corresponding encoding it is opened on.

[0072] In some embodiments, a web page file, also known as a Hypertext Markup Language file, is a special text file that uses Hypertext Markup Language (HTML) to format and present content. HTML files can contain not only text, but also images, links, multimedia content, etc. When a web page file is opened in a web browser, the browser interprets the HTML tags and renders the web page according to the instructions of these tags. Hypertext Markup Language (HTML) is a markup language that includes a series of tags that can unify the document format on the network and connect scattered Internet resources into a logical whole. HTML text is a descriptive text composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, etc.

[0073] In some embodiments, the text document can be converted into a web page file in the following manner: First, the content and structure of the text document need to be read and understood, and the functions of each part of the text, such as title, paragraph, list, etc., are determined. Based on the content of the text document, the layout of the web page is planned, and how to convert the text into HTML elements is determined. For example, the title of the document may correspond to the HTML element. <h1> arrive< / h1> <h6>Tags, paragraph correspondence Label, list corresponding and Tags, etc. Start writing HTML documents and create a basic framework, including <!DOCTYPE html> declarations, <!DOCTYPE html>, and <!DOCTYPE html> tags. In the <!DOCTYPE html> section, set the title of the page ( <title> Tags), character encoding (usually< / title> <meta charset="UTF-8"> ), style sheet link ( <link> Tags), etc. Convert the text in the text document into HTML elements according to the planned layout. For example, convert each paragraph into Elements, converting the title to the corresponding <h1> arrive< / h1> <h6>For special formatting, such as bold, italics, etc., you can use <strong>、 <em>If necessary, you can add inline styles (using the style attribute) or external style sheets (through <link> The tag introduces a CSS file) to define the font, color, size and other appearance attributes of the text. Using CSS can further beautify the web page and improve the user experience. If the text document contains multimedia content such as links, audio or video, you need to add the corresponding tags in HTML, such as 、 、 <audio>and <video>After writing your HTML document, you need to check and validate it to ensure that all tags are closed correctly and that there are no syntax errors. Use an online validation tool (such as the W3C HTML Validator) to check that your HTML document complies with standards. Open the generated HTML file in different web browsers to test whether it displays as expected. Ensure that the webpage displays correctly on different devices and resolutions.

[0074] For example, see< / video> < / audio> Figure 6 , Figure 6 This is a schematic diagram of the principle of the web page file provided by the embodiment of the present application. Figure 6 What is shown is the web page file obtained by converting the text document. Figure 6 The web page file shown includes first tag 1, first tag 2, first tag 3, first tag 4, first tag 5, first tag 6, first tag 7, first tag 8, first tag 9, first tag 10, first tag 11, first tag 12, first tag 13, first tag 14, first tag 15, first tag 16, first tag 17, first tag 18, first tag 19, and first tag 20. Different first tags correspond to different texts in the text document, and the first tags correspond one-to-one to the text in the text document.

[0075] In step 102, based on the directory of the text document, a mapping relationship between the title items in the directory and the hierarchies of the title items is constructed.

[0076] In some embodiments, the above-mentioned directory is used to represent the hierarchical relationship between each of the title items in the text document.

[0077] In some embodiments, the table of contents of a text document generally refers to an organizational structure that lists the titles of each section or chapter in the document and their locations in the document (usually page numbers). The table of contents is a list of the various section titles and subtitles listed in the document, usually located at the beginning of the document. It provides a means for readers to quickly navigate to a specific part of the document. The table of contents refers to a list arranged in a certain order and structure in a text document. It is used to represent the hierarchical relationship and arrangement order between the various title items in the document.

[0078] In some embodiments, title items are used to identify different content blocks in a text document, such as chapter titles and subsection titles. These titles are typically distinguished by font size, bolding, formatting, etc. to indicate their importance in the document structure. Title items refer to titles at various levels in a text document, such as chapters, sections, and subsections. These titles are typically distinguished by different font sizes, bolding, or formatting.

[0079] In some embodiments, in a table of contents, the hierarchical relationship between title items refers to the subordinate and inclusive relationship of titles. Typically, the top-level title is the main part of the document, the sub-title is the subdivision under the top-level title, and so on, forming a tree structure. This structure helps readers understand the organization of the document and the hierarchy of information. In a table of contents, the hierarchical relationship between title items refers to the relative position and subordinate relationship of each title in the document structure. The table of contents shows the organizational structure of the document content by listing titles of different levels, from main chapters to sub-sections, so that readers can clearly understand the framework of the document and the relationship between the contents of each part.

[0080] For example, in a book's table of contents, Chapter 1 might be a top-level heading, Section 1.1 a sub-heading under Chapter 1, and Subsection 1.1.1 a more detailed heading under Section 1.1. This hierarchical relationship allows readers to clearly identify the levels of the document structure.

[0081] As an example, in actual application scenarios, building a mapping relationship between title items and their hierarchies based on the table of contents of a text document is often used to help readers quickly navigate and understand the document structure. The table of contents for a book on "Introduction to Computer Science" is as follows:

[0082] 1. Introduction;

[0083] 1.1 Overview of Computer Science;

[0084] 1.1.1 History of Computer Science;

[0085] 1.1.2 Major branches of computer science;

[0086] 1.2 Composition of computer system;

[0087] 1.2.1 Hardware;

[0088] 1.2.2 Software;

[0089] 2. Basics of Computer Programming

[0090] 2.1 Programming languages; 2.1.1 High-level languages;

[0091] 2.1.2 Low-level language;

[0092] 2.2 Programming paradigm;

[0093] 2.2.1 Imperative programming;

[0094] 2.2.2 Functional programming;

[0095] Continuing from the previous example, the table of contents shows the hierarchical relationship between the chapters and sections in the book. The following is the mapping between these headings and their hierarchies:

[0096] Introduction (Level 1);

[0097] 1.1 Overview of Computer Science (Level 2);

[0098] 1.1.1 History of Computer Science (Level 3);

[0099] 1.1.2 Major branches of computer science (Level 3);

[0100] 1.2 Composition of computer systems (Level 2);

[0101] 1.2.1 Hardware (Level 3);

[0102] 1.2.2 Software (Level 3);

[0103] Fundamentals of Computer Programming (Level 1);

[0104] 2.1 Programming language (Level 2);

[0105] 2.1.1 High-level language (Level 3);

[0106] 2.1.2 Low-level language (Level 3);

[0107] 2.2 Programming Paradigm (Level 2);

[0108] 2.2.1 Imperative Programming (Level 3);

[0109] 2.2.2 Functional Programming (Level 3).

[0110] Continuing with the previous example, in this mapping, level 1 represents the main chapters, level 2 represents the sections, and level 3 represents the subsections. This mapping allows readers to intuitively understand the document's structure through the table of contents and quickly locate the section of interest. In electronic documents, this mapping is often combined with hyperlinks, allowing readers to click on a heading in the table of contents to jump directly to the corresponding section of the document.

[0111] In some embodiments, the above step 102 can be implemented as follows: for each title item in the directory, the level of the title item is compared with the level threshold to obtain the level comparison result of the title item; when the level comparison result of the title item indicates that the level of the title item is less than or equal to the level threshold, a mapping relationship between the title item and the level of the title item is constructed.

[0112] In some embodiments, the above-mentioned construction of the mapping relationship between the title item and the hierarchy of the title item can be achieved by: constructing index entries between the tags of the title item and the hierarchy of the title item; and constructing the index entries of each of the title items into the mapping relationship.

[0113] In some embodiments, it is necessary to define a level threshold value, which is used to determine which title items will be included in the final index. For example, if we set the level threshold value to 2, only title items with levels 1 and 2 will be considered for indexing. The level of each title item in the directory is compared with the level threshold value. This comparison operation will produce a comparison result for each title item, i.e., whether the level of the title item is less than or equal to the level threshold value. For title items whose comparison result is true (i.e., the level of the title item is less than or equal to the level threshold value), an index entry will be created. This index entry usually contains the label of the title item (e.g., the title name) and its corresponding level information. The index entries of all eligible title items are collected and constructed into a mapping relationship. This mapping relationship can be a list, a dictionary, or a database table, which associates the label of the title item with its level so that the level information can be quickly found by label, or vice versa.

[0114] In some embodiments, a mapping relationship refers to a correspondence that associates each element in a collection (in this case, the labels of the title items in the directory) with an element in another collection (in this case, the hierarchies of the title items) so that the relationship between these elements can be quickly found and accessed.

[0115] As an example, let's set the level threshold to 2. The level of headings in the catalog is as follows:

[0116] Heading 1 (Level 1); Heading 1.1 (Level 2); Heading 1.2 (Level 2); Heading 2 (Level 1); Heading 2.1 (Level 2); Heading 2.2 (Level 2); Heading 3 (Level 1); Heading 3.1 (Level 2).

[0117] Continuing with the above example, compare the level of the title item with threshold 2: Title 1 (Level 1): does not comply; Title 1.1 (Level 2): ​​complies; Title 1.2 (Level 2): ​​complies; Title 2 (Level 1): does not comply; Title 2.1 (Level 2): ​​complies; Title 2.2 (Level 2): ​​complies; Title 3 (Level 1): does not comply; Title 3.1 (Level 2): ​​complies; build index entries: {"label":"Title 1.1","Level":2}; {"label":"Title 1.2","Level":2}; {"label":"Title 2.1","Level":2}; {"label":"Title 2.2","Level":2}; {"label":"Title 3.1","Level":2};

[0118] Continuing with the above example, the constructed mapping relationship can be as follows (taking a dictionary as an example):

[0119] Mapping relationship = {"Title 1.1":2, "Title 1.2":2, "Title 2.1":2, "Title 2.2":2, "Title 3.1":2}.

[0120] For example, see Figure 7 , Figure 7 This is a schematic diagram of the principle of constructing a mapping relationship provided by an embodiment of the present application. For title item 1, the level (1) of title item 1 is compared with the level threshold (3) to obtain the level comparison result of the title item 1; when the level comparison result of the title item 1 indicates that the level (1) of the title item 1 is less than or equal to the level threshold (3), an index entry between the label (doc_1) of the title item 1 and the level (1) of the title item is constructed: doc_1-1; for title item 2, the level (2) of title item 2 is compared with the level threshold (3) to obtain the level comparison result of the title item 2; when the level (1) of the title item 2 is less than or equal to the level threshold (3), an index entry between the label (doc_1) of the title item 1 and the level (1) of the title item is constructed: doc_1-1; for title item 2, the level (2) of title item 2 is compared with the level threshold (3) to obtain the level comparison result of the title item 2; When the comparison result indicates that the level (2) of the title item 2 is less than or equal to the level threshold (3), an index entry is constructed between the label (doc_1) of the title item 2 and the level (2) of the title item: doc_2-2; for the title item 3, the level (3) of the title item 3 is compared with the level threshold (3) to obtain the level comparison result of the title item 3; when the level comparison result of the title item 3 indicates that the level (3) of the title item 3 is less than or equal to the level threshold (3), an index entry is constructed between the label (doc_3) of the title item 3 and the level (3) of the title item 3: doc_3-3. The index entries of each of the title items are constructed as follows Figure 7 The mapping relationship shown.

[0121] In this way, by comparing the title items in the directory with their hierarchical thresholds and constructing index entries between the title item labels and the hierarchical levels based on the comparison results, a mapping relationship is formed. This not only optimizes the organization and management of the document structure, but also greatly improves the efficiency of users in retrieving and navigating text documents. Users can quickly locate the titles of interest without having to browse page by page, thus saving time and reducing operational inconvenience. In addition, the establishment of mapping relationships provides a basis for automated document analysis and processing, making subsequent functions such as document summarization, content retrieval, and intelligent recommendation more feasible and efficient. The construction of this mapping relationship improves the accessibility and usability of documents, and has a positive impact on improving the accuracy and speed of information retrieval.

[0122] In step 103, the first tags are grouped based on the mapping relationship to obtain a tag group.

[0123] In some embodiments, there is at most one title item in the directory in the text corresponding to the first tag, and the level of the title item in the mapping relationship is less than or equal to a level threshold.

[0124] In some embodiments, a mapping relationship is previously constructed that associates the tags of the title items in the text document directory with their hierarchical levels. This mapping relationship has already filtered out title items with hierarchical levels greater than a hierarchical threshold. The goal is to group the first tags in the web page file according to the mapping relationship so that each tag group corresponds to a title item in the mapping relationship. This means that the first tag contained in each group should match the hierarchical level of a title item in the mapping relationship and correspond to at most one title item in the directory in the text. All the first tags in the web page file are traversed and their tag names and text are extracted. These first tags are compared with the title items in the mapping relationship and their hierarchical levels in the mapping relationship are determined based on the tag names. For each group, its corresponding text is checked to ensure that it contains at most one title item in the mapping relationship. If it contains multiple title items, the grouping needs to be readjusted or the web page content needs to be further split and adjusted. After grouping, each tag group represents a specific part of the web page content and corresponds to a title item in the text document directory. Such grouping helps to structure the understanding of the web page content and makes it easier for users to quickly identify and navigate to related content.

[0125] In certain embodiments, tag group refers to when processing web page file, according to pre-built mapping relation, the first tag contained in the web page is classified and combined according to certain rules to form a set. The first tag in each tag group corresponds to a specific part of the web page text, and this part of the content contains at most a title item in the mapping relation. This means that each grouping represents a unique theme or content block. In the tag group, the text of each grouping follows the singularity constraint, that is, they should only correspond to a title item, so that the specificity and clear hierarchical structure of the content can be guaranteed.

[0126] In some embodiments, the above-mentioned grouping of the first tags based on the mapping relationship to obtain the tag group can be achieved as follows: for each of the first tags in the web page file, query the title item in the mapping relationship from the text corresponding to the first tag to obtain the query result of the first tag, and the query result is used to indicate whether the title item in the mapping relationship exists in the text corresponding to the first tag; based on the query result of each of the first tags, the first tags are grouped to obtain the tag group.

[0127] In some embodiments, in a web page file, each first tag (such as ` <h1>`、`< / h1> <h2>`, etc.) are usually accompanied by a piece of text. These tags and content together constitute the structure and semantic information of the web page. For each first tag in the web page file, it is necessary to extract key information (such as title text) from the corresponding text, and then use this information to query whether there is a matching title item in the mapping relationship. The query result will indicate whether the text corresponding to each first tag has a corresponding title item in the mapping relationship. If there is a corresponding item, it means that the text has a corresponding title level in the directory of the text document; if not, it means that the content is not defined in the directory or its level is higher than the threshold. According to the query results of each first tag, the first tags are grouped. Only when the query results show that there is a title item in the mapping relationship in the text, the tag will be included in the group. The grouping should ensure that the text corresponding to the first tag in each group points to the same title item in the mapping relationship, that is, they belong to the same level and correspond to the same content theme.

[0128] For example, see Figure 8 , Figure 8 This is a schematic diagram of the principle of the text processing method provided by the embodiment of the present application. For each of the first tags in the web page file (first tag 1, first tag 2, first tag 3, first tag 4, first tag 5, first tag 6, first tag 7, first tag 8, first tag 9, first tag 10, first tag 11, first tag 12, first tag 13, first tag 14, first tag 15, first tag 16, first tag 17, first tag 18, first tag 19), from the text corresponding to the first tag (for example, content 1 corresponding to the first tag 1), query Figure 8 The title item in the mapping relationship shown (for example, doc_1: first chapter first level title, doc_2 first chapter second level title) obtains the query result of the first tag, and the query result is used to indicate whether the title item in the mapping relationship exists in the text corresponding to the first tag.

[0129] In this way, a mapping relationship query is performed for each first tag in the web page file to determine whether the corresponding text contains the title item in the mapping relationship, and these tags are grouped based on the query results to obtain a tag group. Therefore, the clarity and navigability of the web page content structure are improved, allowing users to understand and browse the web page content more intuitively. This structured grouping helps search engine optimization and improves the searchability and indexing efficiency of web page content. By matching the web page content with the title item in the mapping relationship, content analysis and data mining can be easily performed, and the obtained tag group provides a solid foundation for subsequent automated processing, such as content summarization, information extraction, and intelligent recommendation functions, greatly improving the efficiency and accuracy of information retrieval and content management.

[0130] In some embodiments, the above-mentioned querying the title item in the mapping relationship from the text corresponding to the first tag to obtain the query result of the first tag can be achieved as follows: each of the title items in the mapping relationship is compared with the text respectively to obtain the content comparison result corresponding to the title item; if each of the content comparison results indicates that the title item does not exist in the text, then it is determined that the query result is that the title item in the mapping relationship does not exist in the text; if the content comparison result exists, indicating that the title item exists in the text, then it is determined that the query result is that the title item in the mapping relationship exists in the text.

[0131] In certain embodiments, each title item in the mapping relationship is compared with the text in order to determine whether the text comprises a part that matches the title item. The comparison process can be achieved through methods such as string matching and text similarity calculations, and the content comparison result is a judgment of whether each title item exists in the text. The comparison result of each title item can be "existence" or "non-existence", indicating whether the content comprises the information represented by this title item. If the content comparison results for all title items are "non-existence", the query result can be determined to be that the title item in the mapping relationship does not exist in the text, which means that any title level defined in the text and the mapping relationship does not match. If the content comparison result for at least one title item is "existence", the query result can be determined to be that the title item in the mapping relationship exists in the text, which indicates that the text at least matches a title level in the mapping relationship. Traverse all title items in the mapping relationship. For each title item, use appropriate text processing technology to compare it with the text. Record the content comparison result for each title item. According to the recorded content comparison result, comprehensively judge the query result.

[0132] As an example, in the application scenario of an online education platform, the platform provides a large number of teaching articles. Each article has a detailed directory, and the title items in the directory correspond to the title tags in the article content. In order to improve the readability and search engine optimization (SEO) of the article, the platform developers want to ensure that the title structure of the article is consistent with the directory. The platform's article directory has been pre-processed and a mapping relationship has been constructed, which contains the title items of the article and its corresponding hierarchy. For example: mapping relationship = {"Introduction": 1"; 1.1 Overview of Computer Science": 2, "1.2 Composition of Computer Systems": 2" 2. Basics of Computer Programming": 1, ..}. Now the platform is going to process a newly uploaded article, and the HTML content of the article contains the following title tags and text:< / h2> <h1> introduction< / h1> ; <h2> 1.1 Overview of Computer Science< / h2> ; <h2> Background and History< / h2> #Note that this title is not in the mapping relationship <h1> 2. Basics of Computer Programming< / h1> The platform will traverse the title items in the mapping relationship and compare them with the title tags in the article. The comparison results show that "Introduction" and "1.1 Overview of Computer Science" exist in the article content and are matched successfully. However, the title "Background and History" is not in the mapping relationship and therefore does not match. 2. Computer Programming Basics, although it exists in the article, does not match due to its hierarchy (the article is <h1> , in the mapping relationship< / h1> <h2>), is also considered a mismatch. Since at least one of the title items (Introduction and 1.1 Overview of Computer Science) exists in the article and matches, the query result is determined to be a title item in the mapping relationship that exists in the text.

[0133] Following the above example, see Figure 7 ,Will Figure 7 Each of the title items in the mapping relationship shown is compared with the text (the text corresponding to the first label 1) to obtain a content comparison result corresponding to the title item; if each of the content comparison results indicates that the title item does not exist in the text (the text corresponding to the first label 1), then the query result is determined to be that the title item in the mapping relationship does not exist in the text (the text corresponding to the first label 1).

[0134] Following the above example, see Figure 7 ,Will Figure 7 Each of the title items in the mapping relationship shown is compared with the text (the text corresponding to the first label 2) to obtain a content comparison result corresponding to the title item; if each of the content comparison results indicates that the title item does not exist in the text (the text corresponding to the first label 2), then the query result is determined to be that the title item in the mapping relationship does not exist in the text (the text corresponding to the first label 2).

[0135] In this way, the comparison can accurately identify whether the text contains the title item, thereby providing an accurate basis for the query result. If all content comparison results show that the text does not contain the title item, then the query result can be determined to be a title item that does not contain the mapping relationship in the text, which helps to avoid interference from invalid information. Conversely, if the content comparison results show that the text does contain the title item, then the query result can be clearly determined to be a title item that contains the mapping relationship in the text, thereby improving the accuracy and efficiency of the query.

[0136] In some embodiments, there are multiple first tags. The above-mentioned grouping of the first tags based on the query results of each of the tags to obtain the tag group can be achieved as follows: the second tag in the web page file is constructed as a tag group of the second tag, and the second tag is any one of the first tags; if the query result of the third tag indicates that the title item in the mapping relationship exists in the text corresponding to the third tag, the third tag is constructed as a tag group, and the third tag and the second tag are different tags in the first tag; if the query result of the third tag indicates that the title item in the mapping relationship does not exist in the text corresponding to the third tag, the third tag is added to the tag group of the second tag.

[0137] In some embodiments, tags in a web page file are grouped to better organize and manage these tags, which may be used in scenarios such as search, classification, and recommendation. The second tag in the web page file is constructed into a tag group. Here, the second tag is any one of the first tags. This means that a specific tag is selected as the representative of the initial tag group. The query results for the third tag are checked. If the text corresponding to the third tag contains a title item in the mapping relationship, the third tag is constructed into a new tag group. Here, the third tag and the second tag are different tags in the first tag, meaning that they are different tags but are both members of the first tag set. If the query results for the third tag indicate that the text corresponding to the third tag does not contain a title item in the mapping relationship, the third tag is added to the tag group of the second tag. This indicates that the third tag has a certain correlation with the second tag because they both lack a mapping relationship with the title item. The title item in the mapping relationship may refer to a predefined rule or standard that determines the relationship between the tag and specific content (such as a title). If these title items exist in the text corresponding to a tag, then this tag may have specific attributes or importance and is therefore grouped separately. The construction of the tag group is based on whether there is a specific title item in the text content corresponding to the tag. If it exists, it will be grouped separately; if it does not exist, it will be grouped into the existing tag group. This logic helps to group tags with similar attributes into one category, while tags with special attributes will be classified separately.

[0138] As an example, suppose there is a web page file containing the following tags (first tag set): tag A; tag B; tag C; tag D. The content (text) corresponding to these tags may or may not contain the title item in the mapping relationship. The title item in the mapping relationship can be a predefined keyword or phrase, such as a title, abstract, keyword, etc. Select the second tag and build a tag group. Suppose we select tag A as the second tag. Construct tag A into a tag group, namely tag group 1: [tag A]. Suppose the third tag is tag B. The query results show that the title item in the mapping relationship exists in the text corresponding to tag B. Therefore, tag B is constructed into a new tag group, namely tag group 2: [tag B]. Continue to check the query results for other tags. Suppose the next third tag is tag C. The query results show that the title item in the mapping relationship does not exist in the text corresponding to tag C. Therefore, tag C is added to the tag group of the second tag, namely tag group 1: [tag A, tag C]. Check the last tag. Suppose the last third tag is tag D. The query results show that the title item in the mapping relationship exists in the text corresponding to tag D. Therefore, label D is constructed as a new label group, namely label group 3: [label D]. The resulting label groups are as follows: label group 1: [label A, label C]; label group 2: [label B]; label group 3: [label D].

[0139] Thus, by intelligently analyzing the text content corresponding to the tags, the tags can be effectively classified and organized. This method not only improves the efficiency of tag management but also enhances the relevance and traceability between tags. By separately grouping the tags with specific title items, it is easier to identify and utilize the importance and particularity of these tags, thereby improving the performance of information retrieval and recommendation systems. At the same time, classifying the tags without title items into existing tag groups helps reduce redundancy and chaos, making the tag system clearer and more organized. Generally speaking, this tag grouping method based on query results can significantly improve the efficiency and effectiveness of tag management, bringing a better user experience.

[0140] In some embodiments, the first tag in the above-mentioned web page file includes the i-th web page tag, where 1 < i ≤ N, and N is the total number of the first tags in the web page file.

[0141] As an example, refer to Figure 6 , Figure 6 The first tags in the web page file shown include First Tag 1, First Tag 2, First Tag 3, First Tag 4, First Tag 5, First Tag 6, First Tag 7, First Tag 8, First Tag 9, First Tag 10, First Tag 11, First Tag 12, First Tag 13, First Tag 14, First Tag 15, First Tag 16, First Tag 17, First Tag 18, First Tag 19, and First Tag 20.

[0142] As an example, refer to Figure 8 , Figure 8 The first tags in the web page file shown include First Tag 1, First Tag 2, First Tag 3, First Tag 4, First Tag 5, First Tag 6, First Tag 7, First Tag 8, First Tag 9, First Tag 10, First Tag 11, First Tag 12, First Tag 13, First Tag 14, First Tag 15, First Tag 16, First Tag 17, First Tag 18, and First Tag 19.

[0143] In some embodiments, the order between different first tags in the web page file is the same as the order of the text corresponding to the first tags in the text document.

[0144] As an example, refer to Figure 6 , Figure 6 The order of the first tag 1, the first tag 2, the first tag 3, the first tag 4, the first tag 5, the first tag 6, the first tag 7, the first tag 8, the first tag 9, the first tag 10, the first tag 11, the first tag 12, the first tag 13, the first tag 14, the first tag 15, the first tag 16, the first tag 17, the first tag 18, the first tag 19 and the first tag 20 shown is the same as the order of the texts corresponding to the first tag 1, the first tag 2, the first tag 3, the first tag 4, the first tag 5, the first tag 6, the first tag 7, the first tag 8, the first tag 9, the first tag 10, the first tag 11, the first tag 12, the first tag 13, the first tag 14, the first tag 15, the first tag 16, the first tag 17, the first tag 18, the first tag 19 and the first tag 20 respectively in the text document.

[0145] In some embodiments, the above-mentioned grouping of the first tags in the web page file based on the query results of each first tag to obtain the tag group can be achieved as follows: the first first tag in the web page file is constructed as the first initial tag group; traversing i to perform the following processing: if the query result of the i-th first tag indicates that the title item in the mapping relationship exists in the text corresponding to the i-th first tag, then the i-th first tag is constructed as the i-th initial tag group, and the i-1-th initial tag group is determined as the tag group.

[0146] In some embodiments, the first tag in the web page file (the 1st first tag) is separately constructed into a group, called the 1st initial tag group. This initial tag group serves as a benchmark for the processing and comparison of subsequent tags. Traversing i means iteratively processing all tags in the web page file, where i is a counter starting from 2, representing the sequence number of the current tag being processed. The i-th first tag is queried to determine whether there is a title item in the mapping relationship in its corresponding text. There are two possibilities for the query result: There is a title item: If the query result shows that there is a title item in the mapping relationship in the text corresponding to the i-th first tag, this means that the content of the current tag has a corresponding relationship with the title item. In this case, the i-th tag is constructed as a new initial tag group, and at the same time, the i-1th initial tag group is determined as the final tag group. This indicates that the i-1th tag group contains information related to the previous tag, and the i-th tag starts a new grouping. There is no title item: If the query result shows that there is no title item in the mapping relationship in the text corresponding to the i-th first tag, this means that the content of the current tag does not directly correspond to the title item. In this case, the i-th tag is added to the i-1-th initial tag group to form the i-th initial tag group. This indicates that the i-th tag belongs to the same group as the i-1-th tag and their contents are related.

[0147] For example, see Figure 8 , change the first tag ( Figure 8 The first tag 1 shown is constructed as the first initial tag group; if the second first tag ( Figure 8 The query result of the first tag 2) shown in the figure indicates that the title item in the mapping relationship does not exist in the text corresponding to the second first tag, then the second first tag is added to the first initial tag group to obtain the second initial tag group; if the third first tag ( Figure 8 If the query result of the first tag 3 shown in FIG3 indicates that the title item in the mapping relationship does not exist in the text corresponding to the third first tag, the third first tag is added to the second initial tag group to obtain the third initial tag group. If the query result of the fourth first tag indicates that the title item in the mapping relationship exists in the text corresponding to the fourth first tag, the fourth first tag is constructed as the fourth initial tag group, and the third initial tag group (as shown in FIG3 ) is added to the second initial tag group to obtain the third initial tag group. Figure 8 The label group A) consisting of the illustrated first label 1 , the first label 3 and the first label 3 is defined as the label group.

[0148] In this way, the tags in the web page file can be effectively grouped according to whether their corresponding texts contain title items in the mapping relationship, which helps to clearly identify and organize the structure and content of the web page. Secondly, when a title item is found in the text corresponding to a certain tag, it is constructed as a new initial tag group, which can not only accurately identify the important information in the text, but also maintain the independence and hierarchy of the tag group. At the same time, the previous tag group is determined as the final tag group, which ensures the consistency and continuity of the grouping and avoids information redundancy and confusion.

[0149] In some embodiments, after the first first tag in the web page file is constructed as the first initial tag group, the following processing can also be performed: if the query result of the i-th first tag indicates that the title item in the mapping relationship does not exist in the text corresponding to the i-th first tag, then the i-th first tag is added to the i-1th initial tag group to obtain the i-th initial tag group.

[0150] In some embodiments, the first tag in the web page file (the 1st first tag) is separately constructed into a group, called the 1st initial tag group. This initial tag group serves as a benchmark for the processing and comparison of subsequent tags. Traversing i means iteratively processing all tags in the web page file, where i is a counter starting from 2, representing the sequence number of the current tag being processed. The i-th first tag is queried to determine whether there is a title item in the mapping relationship in its corresponding text. There are two possibilities for the query result: There is a title item: If the query result shows that there is a title item in the mapping relationship in the text corresponding to the i-th first tag, this means that the content of the current tag has a corresponding relationship with the title item. In this case, the i-th tag is constructed as a new initial tag group, and at the same time, the i-1th initial tag group is determined as the final tag group. This indicates that the i-1th tag group contains information related to the previous tag, and the i-th tag starts a new grouping. There is no title item: If the query result shows that there is no title item in the mapping relationship in the text corresponding to the i-th first tag, this means that the content of the current tag does not directly correspond to the title item. In this case, the i-th tag is added to the i-1-th initial tag group to form the i-th initial tag group. This indicates that the i-th tag belongs to the same group as the i-1-th tag and their contents are related.

[0151] Following the above example, see Figure 8 , if the sixth first label ( Figure 8 The query result of the first tag 6) shown in FIG6 indicates that the title item in the mapping relationship does not exist in the text corresponding to the sixth first tag, then the sixth first tag is added to the fifth initial tag group to obtain the sixth initial tag group; if the seventh first tag ( Figure 8 If the query result of the first tag 7 shown in the figure indicates that the title item in the mapping relationship does not exist in the text corresponding to the seventh first tag, the seventh first tag is added to the seventh initial tag group to obtain the seventh initial tag group; if the query result of the eighth first tag indicates that the title item in the mapping relationship exists in the text corresponding to the eighth first tag, the eighth first tag is constructed as the eighth initial tag group, and the seventh initial tag group (as shown in the figure) is added to the seventh initial tag group to obtain the seventh initial tag group; Figure 8 The label group C) consisting of the illustrated first label 5 , first label 6 and first label 7 is defined as the label group.

[0152] In this way, the tag group with the mapping relationship title item in the text can be effectively identified and constructed. By querying each first tag, it can be found whether there is content that matches the title item in the mapping relationship, thereby accurately dividing each independent tag group. Such processing helps to improve the efficiency of web page content organization and retrieval. The composition of the tag group can be dynamically adjusted. When detecting that there is a mapping relationship title item in the text of a certain first tag, it will be constructed as a new initial tag group, and the previous initial tag group will be determined as final tag group. Like this, along with the carrying out of traversal, the tag group can be gradually refined, more in line with the web page content structure. For the first tag that does not have the mapping relationship title item, it is added in the previous initial tag group to ensure the integrity of the tag group. This method avoids the incomplete tag group caused by omitting some tags, thereby improving the accuracy of the whole web page content organization.

[0153] In step 104, the text document is segmented based on the tag group to obtain a plurality of sub-texts.

[0154] In some embodiments, the above-mentioned sub-texts correspond one-to-one to the tag groups, and the above-mentioned segmentation of the text document based on the tag groups to obtain multiple sub-texts can be achieved as follows: the following processing is performed for each tag group respectively: if the number of the first tags in the tag group is one, the text corresponding to the first tag is determined as the sub-text corresponding to the tag group; if the number of the first tags in the tag group is multiple, the texts corresponding to the first tags are spliced ​​according to the order of the first tags in the tag group to obtain the sub-text corresponding to the tag group, and the arrangement order between the first tags in the tag group is the same as the order of the texts corresponding to the first tags in the text document.

[0155] In some embodiments, when a tag group contains only one first tag, the text corresponding to the first tag is directly determined as the subtext of the tag group. This processing method simplifies the content organization process because it assumes that a single first tag is sufficient to express a complete concept or information segment. This method is suitable for situations where each tag clearly represents an independent information unit, such as a subheading or list item in an article. When a tag group contains multiple first tags, it is necessary to splice their corresponding texts in the order in which these tags are arranged in the document to form the subtext of the tag group, so as to facilitate the maintenance of text coherence: since the order of the first tags in the document usually reflects the logical order of the content, splicing the text in this order can maintain the coherence and readability of the information. Preserve the integrity of the information: Splicing the content of multiple tags together can ensure that no relevant information fragments are missed, which is crucial for understanding the meaning of the entire paragraph or chapter. Improve processing efficiency: By directly using the existing order in the document, additional sorting or reorganization steps are avoided, thereby improving processing efficiency.

[0156] For example, see Figure 8 For tag group B, when the number of the first tag in the tag group B is one, the text corresponding to the first tag 4 in the tag group is determined as the subtext (subtext) corresponding to the tag group B.

[0157] For example, see Figure 8 For tag group D, when there are multiple first tags in the tag group D, the texts corresponding to the first tags are spliced ​​according to the arrangement order of the first tags (first tag 5, first tag 6 and first tag 7) in the tag group to obtain the sub-text corresponding to the tag group. The arrangement order between different first tags in the tag group D is the same as the order of the texts corresponding to the first tags in the text document.

[0158] In some embodiments, after step 104 above, the following processing may also be performed: semantic profiling of the sub-text to obtain a first text of the sub-text, where the first text is used to reflect the semantics of the sub-text, and the content volume of the first text is smaller than the content volume of the sub-text; in response to a request sent by the display party of the text, a segmentation result of the text is constructed based on the first text, and the segmentation result is sent to the display party.

[0159] In some embodiments, semantic profiling of the subtext to obtain the first text of the subtext can be achieved by inputting the subtext into a large language model. Prior to input, the text may need to be preprocessed, such as removing irrelevant formatting information and special characters, to ensure that the input content is clean and suitable for model processing. The large language model analyzes the input subtext to understand its semantics and structure. It identifies key sentences and key words, as well as the logical relationships between them, which are the basis for generating an effective summary. The large language model extracts the core information from the subtext, which typically includes topic sentences, keywords, important data, and conclusions. This information is the main component of the first text. Based on the extracted key information, the large language model generates multiple candidate summary sentences or paragraphs. These candidate summaries strive to cover the main points and details of the original subtext. The candidate summaries are evaluated to compare their similarity with the original content, while ensuring that the first text contains less content than the original subtext. Evaluation criteria include semantic accuracy, information completeness, and text conciseness.

[0160] As an example, consider a news aggregation platform's content summary. Consider a news aggregation platform that wants to provide users with the ability to quickly browse a large amount of news while maintaining accuracy and completeness. The platform crawls full news articles from multiple sources and segments each article into subtexts, such as headlines, lead sentences, and body paragraphs. The platform uses a large language model to generate semantic profiles for each subtext. For example, consider a news article consisting of three paragraphs: the first paragraph (headline and lead sentence) might be summarized as follows: "A technology company has released a smartphone with revolutionary features." The second paragraph (product details) might be summarized as follows: "The phone features the latest processor, an ultra-high screen refresh rate, and a one-week battery life." The third paragraph (market impact) might be summarized as follows: "Analysts predict that the release of this phone will significantly impact the high-end mobile phone market." When a user requests a summary of a news article on the platform, the platform constructs segmented results based on the previously generated first text. For example, the platform combines the three summary sentences into a concise news summary. The platform then sends these segmented results to the user's display interface, allowing users to quickly understand the core content of the news article without reading the entire article. If users are interested in a piece of news and want to know more details, they can click the "Read Full Text" link and the platform will then display the complete news content.

[0161] Continuing with the previous example, a user requests to view a news summary, and the platform responds as follows: The display provider (such as a mobile app) sends a request to the platform: Please provide a summary of the news ID 12345. The platform retrieves the first text of the news ID 12345 and constructs the following segmented results: Title: A technology company releases a revolutionary smartphone; Summary: Equipped with the latest processor, ultra-high screen refresh rate, and one-week battery life; expected to have an impact on the high-end market. The platform sends the constructed segmented results to the mobile app, and the user sees the following display on the app: Title: A technology company releases a revolutionary smartphone. Summary: Equipped with the latest processor, ultra-high screen refresh rate, and one-week battery life; expected to have an impact on the high-end market.

[0162] This approach significantly improves the efficiency and accuracy of information delivery by providing a semantic overview of the subtext and constructing segmented results based on the request. Users can quickly grasp the core semantics of the text without having to read the lengthy original content. This approach reduces the user's reading burden, allowing them to more efficiently filter and digest important information, especially in today's information overload world. Furthermore, since the first text contains less content than the original subtext, it also saves display space, allowing more information summaries to be displayed on a limited screen, improving the density and usability of information display.

[0163] In some embodiments, the above-mentioned construction of the segmentation result of the text based on the first text can be achieved by: constructing the first text and the sub-text as the segmentation result of the text document, or constructing the first text and the tag group as the segmentation result of the text document.

[0164] In some embodiments, by performing semantic profiling on the sub-text, a summary version with smaller content volume is obtained, which not only reflects the semantics of the original text, but also realizes the refinement and compression of information. This processing method allows users to quickly browse and obtain key information, improving the efficiency of information processing. In response to the request sent by the display party, the segmented results constructed based on the first text can be flexibly displayed according to different display requirements and user preferences. This method allows the display party to provide customized content display based on the user's device and context environment. Combining the first text with a structured tag group not only provides core information, but also shows the organizational structure of the information. This is particularly useful for application scenarios that require rapid identification and organization of information (such as knowledge bases, literature reviews, etc.). These methods of constructing segmented results can enhance user experience, reduce unnecessary information burden, and adapt to different content consumption scenarios. They provide users with a more efficient and personalized way to obtain information, but also place higher requirements on the data processing and user interface design of the content provider.

[0165] In this way, a text document is converted into a web page file, the web page file includes a first tag, different first tags correspond to different texts in the text document, and based on the directory of the text document, a mapping relationship between the title items in the directory and the hierarchy of the title items is constructed. Based on the mapping relationship, the first tags in the web page file are grouped to obtain a tag group. Based on the text corresponding to the first tag in the tag group, the text document is segmented to obtain subtexts of the text document. In this way, the text document is converted into a web page file containing the first tag, and a structural identifier is given to the text. This automated conversion process improves the efficiency of content organization and avoids the tedious work of manual tagging and classification. By constructing a mapping relationship between the title items in the directory and the hierarchy of the title items based on the directory of the text document, and constructing a mapping relationship between the title items in the directory and their hierarchy, a clear structural framework is provided for text segmentation. Segmentation can be performed directly based on the hierarchical structure of the directory, reducing the complexity of segmentation, thereby simplifying the processing process through the mapping relationship. Based on the mapping relationship, the first tags in the web page file are grouped to obtain tag groups. By grouping the first tags based on the mapping relationship, the content can be divided into logically related tag groups, because the segmentation work can be concentrated on the tag groups with similar content rather than the entire document, thereby improving the segmentation efficiency. Based on the text corresponding to the first tag in the tag group, the text document is segmented to obtain the sub-text of the text document. The text corresponding to the first tag in the tag group is used for segmentation, which realizes the automation of the segmentation process and does not require the directory tree of the text document to implement segmentation, thereby effectively improving the segmentation efficiency of the text document.

[0166] See also Figure 5 , Figure 5 This is a flowchart of the text processing method provided in the embodiment of the present application. Figure 2 , will combine Figure 5 Steps 201 to 203 are shown for illustration. The text processing method provided in the embodiment of the present application can be implemented by the server or the terminal alone, or by the server and the terminal in collaboration. The following will be described using the terminal alone as an example.

[0167] In step 201, a text document is displayed.

[0168] In some embodiments, displaying a text document refers to the process of presenting text to a user. Before display, the text needs to be formatted and processed, which may include text encoding, font selection, size setting, color annotation, paragraph division, link addition, etc., to ensure that the text is readable and attractive when displayed. Text can be displayed through a variety of interfaces, including but not limited to the following: Desktop applications: such as text editors, word processing software, etc. Web browsers: present text to users through HTML and CSS. Mobile applications: applications designed for smartphones and tablets. E-readers: devices such as Kindle, which are specifically designed to display e-books and other long texts. Displaying text documents usually allows users to interact, such as scrolling, searching for specific text, adjusting font size, adding comments, etc. When displaying a text document, the formatting and layout of the text are usually taken into consideration, including page margins, line spacing, paragraph indentation, and the formatting of titles and subtitles, etc., to ensure the clarity and aesthetics of the text. With the popularity of different devices and screen sizes, adaptive design needs to be considered when displaying text documents to ensure that the text can be displayed correctly on different devices and screens and maintain a good user experience.

[0169] In step 202, in response to the segmentation instruction for the text document, a segmentation request for the text is sent.

[0170] In some embodiments, the terminal sends a segmentation request for the text to the server in response to the segmentation instruction for the text document.

[0171] In some embodiments, when a system for displaying a text document receives a segmentation instruction, it first needs to understand the specific requirements of the instruction. The segmentation instruction typically specifies how the system should divide the text, such as by paragraph, chapter, topic, or keyword. Once the instruction is understood, the system generates a request for text segmentation. This request may be sent to a background processing service or invoke an internal algorithm to perform content analysis on the specified text document and generate segmentation results.

[0172] In step 203 , a plurality of sub-texts of the text document returned in response to the segmentation request are received.

[0173] In some embodiments, the subtext is obtained by segmenting the text document based on tag groups.

[0174] In some embodiments, the tag group is obtained by grouping the first tags in the web page file of the text document based on a mapping relationship, and the mapping relationship is obtained based on the title items in the directory of the text document and the hierarchy of the title items.

[0175] In some embodiments, after the above step 203, the following processing may also be performed: if the segmentation result includes the subtext of the text document and the second text of the subtext, the subtext and the second text are displayed; the second text is obtained by performing a semantic profile on the subtext, the second text is used to reflect the semantics of the subtext, and the content volume of the second text is less than the content volume of the subtext; if the segmentation result includes the second text and the tag group, the tags in the tag group are rendered, and the second text is displayed.

[0176] In some embodiments, the above-mentioned segmented results may carry a tag group or subtext. When the segmented results carry a tag group, the client may render the first tag in the tag group to display the subtext corresponding to the tag group in the client. When the segmented results carry subtext, the client does not need to render and can directly display the subtext. Since the amount of information in the tag group is less than that in the subtext, carrying a tag group in the segmented results can effectively improve the communication efficiency between the client and the server, but the subsequent rendering process will also take up a certain amount of runtime. Although the communication efficiency between the client and the server is low when the segmented results carry subtext, no subsequent rendering is required, which saves the runtime brought by the rendering. Therefore, the execution efficiency of the tag group or subtext carried in the above-mentioned segmented results is comparable and can be executed in any of the ways.

[0177] In this way, a text document is converted into a web page file, the web page file includes a first tag, different first tags correspond to different texts in the text document, and based on the directory of the text document, a mapping relationship between the title items in the directory and the hierarchy of the title items is constructed. Based on the mapping relationship, the first tags in the web page file are grouped to obtain a tag group. Based on the text corresponding to the first tag in the tag group, the text document is segmented to obtain subtexts of the text document. In this way, the text document is converted into a web page file containing the first tag, and a structural identifier is given to the text. This automated conversion process improves the efficiency of content organization and avoids the tedious work of manual tagging and classification. By constructing a mapping relationship between the title items in the directory and the hierarchy of the title items based on the directory of the text document, and constructing a mapping relationship between the title items in the directory and their hierarchy, a clear structural framework is provided for text segmentation. Segmentation can be performed directly based on the hierarchical structure of the directory, reducing the complexity of segmentation, thereby simplifying the processing process through the mapping relationship. Based on the mapping relationship, the first tags in the web page file are grouped to obtain tag groups. By grouping the first tags based on the mapping relationship, the content can be divided into logically related tag groups, because the segmentation work can be concentrated on the tag groups with similar content rather than the entire document, thereby improving the segmentation efficiency. Based on the text corresponding to the first tag in the tag group, the text document is segmented to obtain the sub-text of the text document. The text corresponding to the first tag in the tag group is used for segmentation, which realizes the automation of the segmentation process and does not require the directory tree of the text document to implement segmentation, thereby effectively improving the segmentation efficiency of the text document.

[0178] Below, an exemplary application of the embodiment of the present application in an actual text document application scenario will be described.

[0179] In some embodiments, based on the POI tool, the word document is parsed into html text, and the directory in the document is parsed. A document segmentation and splitting directory id mapping table is constructed. During the user segmentation process, the chapter directory level of the current node is obtained according to the node id. When the chapter directory level is less than or equal to 3, it will be added to the mapping table (only split to level 3 titles). Based on the Jsoup tool, the html text state html memory node object, then the first-level node is obtained, and the nodes are traversed in sequence to obtain the node id and the chapter directory level from the segmentation split directory id mapping table. When the node id is null or the chapter directory level is null, it is added to the segment node list currently being assembled; when the node id is not equal to the segment node list id currently being assembled, it means that the current node and the nodes in the segment node list currently being assembled do not belong to the same chapter, and a new segment node list needs to be opened. After all nodes are traversed and the segment list is assembled, the plain text of the node in each segment is extracted, and a text summary is initiated and stored in the segment summary storage data table. The browser loads the segment summary data, and the backend returns the segment source HTML text and summary text. The browser renders the segment source HTML text and displays the summary text on the right for the user to query.

[0180] In some embodiments, see Figure 9 , Figure 9 This is a flowchart of the text processing method provided in the embodiment of the present application. Figure 3 By parsing the doc document using POI, we obtain the HTML text and document directory list. We then parse the HTML using Jsoup to obtain the HTML memory node list and segment split target ID mapping table. We then perform segment splitting and node plain text extraction to obtain the segment node list and node plain text. We then perform text summarization to obtain the document summary.

[0181] In some embodiments, see Figure 10 , Figure 10 This is a flowchart of the text processing method provided in the embodiment of the present application. Figure 4 , word document is parsed based on POI tool, and html text document directory list is obtained. It is parsed based on Jsoup tool, and html memory node is obtained. Document directory list is constructed, document directory list is traversed, segmentation directory id mapping table is constructed, htnl memory node is traversed to perform segmentation, document directory level is checked, document directory id and directory level id are decomposed to judge, segment node list is constructed, segment node plain text is extracted, text summary is sent, and summary result is rendered.

[0182] In some embodiments, a Word document is parsed into HTML format content based on a POI parsing tool. The document's directory is parsed, a directory ID is generated, and the directory is marked in the HTML text (the tag ID is set to the directory ID) for anchor positioning during browser preview. An example of parsed HTML format text is as follows:

[0183] Content 1

[0184] Content 2

[0185] Content 3

[0186] <p class="a x1"id="doc_1"> 1. Chapter 1 First Level Title

[0187] <p class="a x2"id="doc_2"> 1.1. Chapter 1 Secondary Title 1

[0188] Content 4

[0189] Content 5

[0190] <p class="a x3"id="doc_3"> 1.1.1. Chapter 1 Level 3 Title 1

[0191] Content 7

[0192] Content 8

[0193] <p class="a x3"id="doc_4"> 1.1.2. Chapter 1 Level 3 Title 2

[0194] Content 9

[0195] Content 10

[0196] <p class="a x2"id="doc_5"> 1.2. Chapter 1 Secondary Title 2

[0197] Content 11

[0198] <p class="a x3"id="doc_6"> 1.2.1. Chapter 1 Level 3 Title 1

[0199] Content 12

[0200] <p class="a x4"id="doc_7"> 1.2.1.1. Chapter 1 Level 4 Title 1

[0201] Content 13

[0202] in <p id="doc_xxx"> xxx The id="doc_xxx" in the file is the directory anchor ID. The metadata information used to locate the document location by clicking the directory is as follows:

[0203] {

[0204] "navigationList":[

[0205] {

[0206] "id":"doc_1",

[0207] "name":"1. Chapter 1 Level 1 Title",

[0208] "level":1

[0209] },

[0210] {

[0211] "id":"doc_5",

[0212] "name":"1.2, Chapter 1 Secondary Title 2",

[0213] "level":2

[0214] },

[0215] {

[0216] "id":"doc_6",

[0217] "name":"1.2.1, Chapter 1, Level 3 Title 1",

[0218] "level":3

[0219] },

[0220] {

[0221] "id":"doc_7",

[0222] "name":"1.2.1.1, Chapter 1 Level 4 Title 1",

[0223] "level":4

[0224] },

[0225] {

[0226] "id":"doc_2",

[0227] "name":"1.1, Chapter 1 Secondary Title 1",

[0228] "level":2

[0229] },

[0230] {

[0231] "id":"doc_3",

[0232] "name":"1.1.1, Chapter 1, Level 3 Title 1",

[0233] "level":3

[0234] }, {

[0235] "id":"doc_4",

[0236] "name":"1.1.2, Chapter 1 Level 3 Title 2",

[0237] "level":3

[0238] }

[0239] }

[0240] navigationList: represents the directory list of documents

[0241] Segmentation rule definition

[0242] Since the actual document is much larger than the one in the example, the parsed HTML text is more complex and larger, with more fragments. Therefore, before initiating text summarization, it is necessary to segment the document and extract the plain text before initiating summary.

[0243] In this solution, the segmentation rule is defined as the content between two chapter directories as a segment, as follows: the content between the chapter directories is a segment, up to the third-level title (and no more splitting below the third-level title). If there is no chapter directory, no segmentation is performed.

[0244] For example:

[0245] Content 1

[0246] Content 2

[0247] Content 3

[0248] <p class="a x1"id="doc_1"> 1. Chapter 1 First Level Title

[0249] <p class="a x2"id="doc_2"> 1.1. Chapter 1 Secondary Title 1

[0250] Content 4

[0251] Content 5

[0252] <p class="a x3"id="doc_3"> 1.1.1. Chapter 1 Level 3 Title 1

[0253] Content 7

[0254] Content 8

[0255] <p class="a x3"id="doc_4"> 1.1.2. Chapter 1 Level 3 Title 2

[0256] Content 9

[0257] Content 10

[0258] <p class="a x2"id="doc_5"> 1.2. Chapter 1 Secondary Title 2

[0259] Content 11

[0260] <p class="a x3"id="doc_6"> 1.2.1. Chapter 1 Level 3 Title 1

[0261] Content 12

[0262] <p class="a x4"id="doc_7"> 1.2.1.1. Chapter 1 Level 4 Title 1

[0263] Content 13

[0264] The above content will be divided into 6 paragraphs: one paragraph between the first-level title and the second-level title, one paragraph between the second-level title and the third-level title, and one paragraph below the third-level title.

[0265] If there is a fourth-level title under the third-level title, the title will not be split further.

[0266] The segmentation results are as follows:

[0267] -------------------------Section 1-------------------------

[0268] Content 1

[0269] Content 2

[0270] Content 3

[0271] -------------------------Section 1-------------------------

[0272] -------------------------Section 2-------------------------

[0273] <p class="a x1"id="doc_1"> 1. Chapter 1 First Level Title

[0274] -------------------------Section 2-------------------------

[0275] -------------------------Section 3-------------------------

[0276] <p class="a x2"id="doc_2"> 1.1. Chapter 1 Secondary Title 1

[0277] Content 4

[0278] Content 5

[0279] -------------------------Section 3-------------------------

[0280] -------------------------Section 4-------------------------

[0281] <p class="a x3"id="doc_3"> 1.1.1. Chapter 1 Level 3 Title 1

[0282] Content 7

[0283] Content 8

[0284] -------------------------Section 4-------------------------

[0285] -------------------------Section 5-------------------------

[0286] <p class="a x3"id="doc_4"> 1.1.2. Chapter 1 Level 3 Title 2

[0287] Content 9

[0288] Content 10

[0289] -------------------------Section 5-------------------------

[0290] -------------------------Section 6-------------------------

[0291] <p class="a x2"id="doc_5"> 1.2. Chapter 1 Secondary Title 2

[0292] Content 11

[0293] -------------------------Section 6-------------------------

[0294] -------------------------Section 7-------------------------

[0295] <p class="a x3"id="doc_6"> 1.2.1. Chapter 1 Level 3 Title 1

[0296] Content 12

[0297] <p class="a x4"id="doc_7"> 1.2.1.1. Chapter 1 Level 4 Title 1

[0298] Content 13

[0299] -------------------------Section 7-------------------------

[0300] In some embodiments, see Figure 7 , build segment split directory id mapping table, such as Figure 7 As shown, the directories are traversed one by one. If the level of the node is less than or equal to 3, it is added to the directory ID mapping table, and finally a segmented split directory ID mapping table is obtained, which is used for segmented splitting to determine the split position.

[0301] In some embodiments, see Figure 8 , perform segmentation splitting, first parse the html text into a list of html node objects based on the Jsoup tool, obtain the first-level node list, a total of 19 nodes, and then traverse them one by one. Traverse each node, obtain the node id, and according to the node id to the segmentation split directory id mapping table, obtain the directory level of the current node. If the node id is null or the node directory level is null, put it into the segment node list currently being assembled. When the node id is not equal to the id of the segment node list currently being assembled, it means that the current node and the node in the segment node list being assembled do not belong to the same chapter, so a new segment node list needs to be opened. Until all nodes are traversed and assembled into the segment node list, the following is obtained. Figure 8 The 7 segment node lists in the list are extracted and sent to the big model for text summarization. After all the segment summaries are completed, the following is obtained: Figure 8 The shown segments summarize the storage data table.

[0302] In some embodiments, see Figure 11 , Figure 11 This is a schematic diagram of the principle of the text processing method provided in the embodiment of the present application. Figure 2 , through the segment summary storage data table (the segment summary storage data table includes the HTML text of segment 1 to segment 7, the plain text of segment 1 to segment 7, and the summary text of segment 1 to segment 7), load the document summary, obtain the document summary, render the document through the front-end browser, and obtain the browser-rendered document and summary text.

[0303] In some embodiments, see Figure 12 , Figure 12 This is a schematic diagram of the display effect of the text processing method provided in an embodiment of the present application. The front end initiates a document content query request, the back end returns a segmented summary storage data table, and then the front end browser renders the segmented HTML text in sequence, and displays the text summary on the right side of the browser. When the mouse hovers over the summary text or segmented HTML text, the sub-text is highlighted.

[0304] In this way, to obtain the key content in the document, it is necessary to read the entire document. After summarizing the document, it can quickly help users learn and understand the document. After the document is segmented, the summary is initiated. The document summary has a small granularity, the summary performance is higher, and it is more in line with the user's reading habits, and the user experience is better (read a paragraph of content and view the summary at the same time, and quickly understand the current paragraph content). When viewing the summary, the document subtext and the corresponding summary text are highlighted according to the position of the user's mouse, which facilitates the user to accurately locate the document summary position and the document segment corresponding to the summary text. A directory id mapping table is constructed based on the directory list as the basis for directory segmentation judgment, which improves segmentation efficiency. Directory matching based on directory id improves the accuracy of segmentation recognition.

[0305] It is understandable that in the embodiments of the present application, when text documents and other related data are involved, when the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0306] The following continues to describe the exemplary structure of the text processing device 455 provided in the embodiment of the present application implemented as a software module. In some embodiments, such as Figure 2 As shown, the software modules in the text processing device 455 stored in the memory 450 may include: a conversion module for converting the text document into a web page file, the web page file including a first tag, the first tag corresponding one-to-one to the text in the text document; a construction module for constructing a mapping relationship between the title items in the directory and the hierarchy of the title items based on the directory of the text document; a grouping module for grouping the first tags based on the mapping relationship to obtain multiple tag groups; a segmentation module for segmenting the text document based on the tag groups to obtain multiple sub-texts.

[0307] In some embodiments, the above-mentioned construction module is also used to compare the level of each title item in the directory with the level threshold to obtain the level comparison result of the title item; if the level comparison result of the title item indicates that the level of the title item is less than or equal to the level threshold, then construct a mapping relationship between the label of the title item and the level of the title item.

[0308] In some embodiments, the above-mentioned grouping module is also used to query the title item in the mapping relationship from the text corresponding to the first tag for each first tag in the web page file, and obtain the query result of the first tag, and the query result is used to indicate whether the title item in the mapping relationship exists in the text corresponding to the first tag; based on the query results of each first tag, the first tags are grouped to obtain the tag group.

[0309] In some embodiments, the above-mentioned grouping module is also used to compare each of the title items in the mapping relationship with the text respectively to obtain a content comparison result corresponding to the title item; if each of the content comparison results indicates that the title item does not exist in the text, then the query result is determined to be that the title item in the mapping relationship does not exist in the text; if the content comparison result exists, indicating that the title item exists in the text, then the query result is determined to be that the title item in the mapping relationship exists in the text.

[0310] In some embodiments, the above-mentioned grouping module is also used to construct the second tag in the web page file into a tag group of the second tag, and the second tag is any one of the first tags; if the query result of the third tag indicates that the title item in the mapping relationship exists in the text corresponding to the third tag, then the third tag is constructed into a tag group, and the third tag and the second tag are different tags in the first tag; if the query result of the third tag indicates that the title item in the mapping relationship does not exist in the text corresponding to the third tag, then the third tag is added to the tag group of the second tag.

[0311] In some embodiments, the sub-text corresponds one-to-one to the tag group, and the above-mentioned segmentation module is also used to perform the following processing for each tag group: if the number of first tags in the tag group is one, the text corresponding to the first tag is determined as the sub-text corresponding to the tag group; if the number of first tags in the tag group is multiple, the text corresponding to the first tags is spliced ​​according to the order of each first tag in the tag group to obtain the sub-text corresponding to the tag group; the order between the first tags in the tag group is the same as the order of the text corresponding to the first tags in the text document.

[0312] In some embodiments, the above-mentioned text processing device also includes: a summarizing module for performing semantic profiling on the sub-text to obtain a first text of the sub-text; in response to a request sent by the display party of the text document, constructing a segmentation result of the text document based on the first text, and sending the segmentation result to the display party.

[0313] In some embodiments, the summarizing module is further configured to construct the first text and the subtext into a segmentation result of the text document, or to construct the first text and the tag group into a segmentation result of the text document.

[0314] The following continues to describe the exemplary structure of the text processing device 555 provided in the embodiment of the present application implemented as a software module. In some embodiments, such as Figure 3 As shown, the software modules in the text processing device 555 stored in the memory 450 may include: a sending module for sending a segmentation request of the text document in response to a segmentation instruction of the text document; a receiving module for receiving multiple sub-texts of the text document returned for the segmentation request, wherein the sub-texts are obtained by segmenting the text document based on the tag group; the tag group is obtained by grouping the first tag in the web page file of the text document based on a mapping relationship, and the mapping relationship is obtained based on the title items in the directory of the text document and the hierarchical construction of the title items.

[0315] In some embodiments, the above-mentioned receiving module is also used to display the sub-text and the second text if the segmentation result includes a sub-text of the text document and a second text of the sub-text; the second text is obtained by performing a semantic profile on the sub-text; if the segmentation result includes the second text and the tag group, the first tag in the tag group is rendered and the second text is displayed.

[0316] The present invention provides a computer program product comprising a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the text processing method described in the present invention.

[0317] The embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, the processor will execute the text processing method provided by the embodiment of the present application, for example, Figure 4 The text processing method is shown.

[0318] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or various electronic devices including one or any combination of the above memories.

[0319] In some embodiments, computer-executable instructions may be in the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0320] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinating files (e.g., files storing one or more modules, subroutines, or code portions).

[0321] By way of example, computer-executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed across multiple sites and interconnected by a communication network.

[0322] In summary, the embodiments of the present application have the following beneficial effects:

[0323] (1) By converting a text document into a web page file, the web page file includes a first tag, and based on the directory of the text document, a mapping relationship between the title items in the directory and the hierarchy of the title items is constructed. Based on the mapping relationship, the first tag is grouped to obtain a tag group, and the text document is segmented based on the tag group to obtain multiple sub-texts. In this way, the text document is converted into a web page file containing the first tag, and a structural identifier is given to the text. This automated conversion process improves the efficiency of content organization and avoids the tedious work of manual tagging and classification. By constructing a mapping relationship between the title items in the directory and the hierarchy of the title items based on the directory of the text document, and constructing a mapping relationship between the title items in the directory and their hierarchy, a clear structural framework is provided for text segmentation. Segmentation can be directly performed based on the hierarchical structure of the directory, reducing the complexity of segmentation, and thus simplifying the processing process through the mapping relationship. Based on the mapping relationship, the first tags are grouped to obtain tag groups. By grouping the first tags based on the mapping relationship, the content can be divided into logically related tag groups, because the segmentation work can be concentrated on the tag groups with similar content rather than the entire document, thereby improving the segmentation efficiency. The text document is segmented based on the tag group to obtain multiple sub-texts, and the text corresponding to the first tag in the tag group is used for segmentation, which realizes the automation of the segmentation process and does not require the directory tree of the text document to implement segmentation, thereby effectively improving the segmentation efficiency of the text document.

[0324] (2) By comparing the title items in the directory with their hierarchical thresholds and constructing index entries between the title item labels and the hierarchical levels based on the comparison results, a mapping relationship is formed. This not only optimizes the organization and management of the document structure, but also greatly improves the efficiency of users in retrieving and navigating text documents. Users can quickly locate the titles of interest without having to browse page by page, thus saving time and reducing operational inconvenience. In addition, the establishment of a mapping relationship provides a basis for automated document analysis and processing, making subsequent document summarization, content retrieval, and intelligent recommendation functions more feasible and efficient. The construction of this mapping relationship improves the accessibility and usability of documents, and has a positive impact on improving the accuracy and speed of information retrieval.

[0325] (3) By performing a mapping relationship query on each first tag in the web page file to determine whether the corresponding text contains the title item in the mapping relationship, and grouping these tags based on the query results to obtain a tag group. The clarity and navigability of the web page content structure are improved, allowing users to understand and browse the web page content more intuitively. This structured grouping helps search engine optimization and improves the searchability and indexing efficiency of web page content. By matching the web page content with the title item in the mapping relationship, content analysis and data mining can be easily performed. The obtained tag group provides a solid foundation for subsequent automated processing, such as content summarization, information extraction, and intelligent recommendation, greatly improving the efficiency and accuracy of information retrieval and content management.

[0326] (4) The comparison can accurately identify whether the text contains the title item, thereby providing an accurate basis for the query result. If all content comparison results show that the text does not contain the title item, then the query result can be determined to be the title item that does not contain the mapping relationship in the text, which helps to avoid interference from invalid information. Conversely, if the content comparison results show that the text does contain the title item, then the query result can be clearly determined to be the title item that contains the mapping relationship in the text, thereby improving the accuracy and efficiency of the query.

[0327] (5) It can effectively group the tags in the web page file according to whether their corresponding text contains the title item in the mapping relationship, thereby helping to clearly identify and organize the structure and content of the web page. Secondly, when a title item is found in the text corresponding to a certain tag, it is constructed as a new initial tag group, which can not only accurately identify the important information in the text, but also maintain the independence and hierarchy of the tag group. At the same time, the previous tag group is determined as the final tag group, ensuring the consistency and continuity of the grouping and avoiding information redundancy and confusion.

[0328] (6) It is possible to effectively identify and construct tag groups with mapping relationship title items in the text. By querying each first tag, it can be found whether there is content that matches the title item in the mapping relationship, thereby accurately dividing each independent tag group. Such processing helps to improve the efficiency of web page content organization and retrieval. The composition of the tag group can be dynamically adjusted. When a mapping relationship title item is detected in the text of a certain first tag, it will be constructed as a new initial tag group, and the previous initial tag group will be determined as the final tag group. In this way, as the traversal proceeds, the tag group can be gradually refined and more in line with the web page content structure. For the first tag that does not have a mapping relationship title item, it is added to the previous initial tag group to ensure the integrity of the tag group. This method avoids the incompleteness of the tag group caused by the omission of certain tags, thereby improving the accuracy of the entire web page content organization.

[0329] (7) The subtext is semantically profiled and segmented based on the request, which greatly improves the efficiency and accuracy of information transmission. Users can quickly obtain the core semantics of the text in a short time without having to read the lengthy original content. This processing method reduces the reading burden of users, especially in today's information overload, allowing users to filter and digest important information more efficiently. At the same time, since the content of the first text is smaller than the original subtext, it also saves display space, allowing more information summaries to be displayed on a limited screen, improving the density and usability of information display.

[0330] (8) To obtain the key content in a document, it is necessary to read the entire document. Summarizing the document can quickly help users learn and understand the document. Summarizing the document after segmenting it can help users learn and understand it quickly. The document summary has a small granularity, a higher summary performance, and is more in line with the user's reading habits, resulting in a better user experience (viewing a paragraph of content while viewing the summary, and quickly understanding the current paragraph content). When viewing the summary, the document subtext and the corresponding summary text are highlighted according to the user's mouse position, making it easier for users to accurately locate the document summary position and the document segment corresponding to the summary text. A directory id mapping table is constructed based on the directory list as a basis for directory segmentation judgment, which improves segmentation efficiency. Directory matching based on directory id improves the accuracy of segmentation recognition.

[0331] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are included in the scope of protection of the present application.< / h2> < / em> < / strong> < / h6> < / h6>

Claims

1. A text processing method, characterized in that: The method comprises: Converting a text document into a web page file, wherein the web page file includes a first tag, and the first tag corresponds to the text in the text document in a one-to-one manner; Based on the directory of the text document, constructing a mapping relationship between title items in the directory and the hierarchies of the title items; Based on the mapping relationship, grouping the first tags to obtain multiple tag groups; The text document is segmented based on the tag group to obtain a plurality of sub-texts.

2. The method according to claim 1, characterized in that The step of constructing a mapping relationship between title items in the directory and hierarchies of the title items based on the directory of the text document includes: For each of the title items in the directory, comparing the level of the title item with a level threshold to obtain a level comparison result of the title item; If the level comparison result indicates that the level of the title item is less than or equal to the level threshold, a mapping relationship between the title item and the level of the title item is established.

3. The method according to claim 1, characterized in that The first tags are grouped based on the mapping relationship to obtain multiple tag groups, including: For each first tag in the webpage file, query the text corresponding to the first tag for a title item in the mapping relationship to obtain a query result for the first tag, wherein the query result indicates whether the text corresponding to the first tag contains the title item in the mapping relationship; The first tags are grouped based on the query results of the first tags to obtain the tag group.

4. The method according to claim 3, characterized in that The number of the first tags is multiple; The step of grouping the first tags based on the query results of the tags to obtain the tag group includes: constructing the second tag in the web page file into a tag group of the second tag, where the second tag is any one of the first tags; If the query result of the third tag indicates that the title item in the mapping relationship exists in the text corresponding to the third tag, the third tag is constructed into a tag group, and the third tag and the second tag are different tags in the first tag; If the query result of the third tag indicates that the title item in the mapping relationship does not exist in the text corresponding to the third tag, the third tag is added to the tag group of the second tag.

5. The method according to claim 1, wherein The subtexts correspond to the tag groups one by one, and the text document is segmented based on the tag groups to obtain a plurality of subtexts, including: The following processing is performed for each tag group: If the number of the first tag in the tag group is one, determining the text corresponding to the first tag as the subtext corresponding to the tag group; If there are multiple first tags in the tag group, the texts corresponding to the first tags are spliced ​​according to the order of the first tags in the tag group to obtain the sub-text corresponding to the tag group; the order between the first tags in the tag group is the same as the order of the texts corresponding to the first tags in the text document.

6. The method according to claim 1, characterized in that After segmenting the text document based on the tag group to obtain a plurality of sub-texts, the method further includes: Performing semantic profiling on the subtext to obtain a first text of the subtext; In response to a request sent by a display party of the text document, a segmentation result of the text document is constructed based on the first text, and the segmentation result is sent to the display party.

7. The method according to claim 6, characterized in that The constructing a segmentation result of the text document based on the first text includes: The first text and the subtext are constructed as a segmentation result of the text document, or, The first text and the tag group are constructed as a segmentation result of the text document.

8. A text processing method, characterized in that: The method comprises: In response to the segmentation instruction of the text document, sending a segmentation request for the text document; Receive multiple sub-texts of the text document returned in response to the segmentation request, wherein the sub-texts are obtained by segmenting the text document based on tag groups; the tag groups are obtained by grouping the first tags in the web page file of the text document based on a mapping relationship, and the mapping relationship is obtained based on title items in the directory of the text document and the hierarchical construction of title items.

9. The method according to claim 8, characterized in that After receiving the plurality of subtexts of the text document returned in response to the segmentation request, the method further includes: If the segmentation result includes a subtext of the text document and a second text of the subtext, the subtext and the second text are displayed; the second text is obtained by performing a semantic summary on the subtext; If the segmentation result includes the second text and the tag group, the first tag in the tag group is rendered and the second text is displayed.

10. An electronic device, characterized in that: The electronic device comprises: a memory for storing computer-executable instructions or computer programs; A processor, configured to implement the text processing method according to any one of claims 1 to 9 when executing the computer-executable instructions or computer program stored in the memory.

11. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the text processing method according to any one of claims 1 to 9 is implemented.

12. A computer program product comprising a computer program or computer executable instructions, characterized in that When the computer program or computer executable instructions are executed by a processor, the text processing method according to any one of claims 1 to 9 is implemented.