A document outline extraction method and device, an electronic device, and a storage medium

CN115310436BActive Publication Date: 2026-08-21ZHUHAI KINGSOFT OFFICE SOFTWARE +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110497223.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-07
Publication Date
2026-08-21
Estimated Expiration
2041-05-07

AI Technical Summary

Technical Problem

[0005]本发明实施例的目的在于提供一种文档提纲的抽取方法、装置、电子设备及存储介质,以解决无法根据用户的提纲标题查看需求,生成对应的提纲列表的问题

Benefits of technology

[0060]The solution provided by this invention involves obtaining multiple outline titles from a target document, wherein the obtained multiple outline titles are sorted according to their positional order in the target document; based on the naming structure of the outline titles and their positional order in the target document, the level to which the outline titles belong is determined; and the multiple outline titles belonging to the predetermined level are merged according to the order of the levels to obtain a target outline list. Therefore, this solution can generate an outline list of multiple target outline titles at a predetermined level when generating the target outline list, that is, it can generate an outline list of multiple target outline titles at the level required by the user. This solves the problem of existing technologies that cannot generate corresponding outline lists based on the user's outline title viewing needs, resulting in a poor user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115310436B_ABST
    Figure CN115310436B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a kind of skeleton list generation method, device, electronic equipment and storage medium, applied to computer technology field, the extraction method includes: obtaining multiple skeleton titles in target document;Determine the level to which the skeleton title belongs based on the naming structure of the skeleton title and the position order in the target document;Multiple skeleton titles belonging to predetermined level are fused according to the order of the level, and the target skeleton list is obtained.It can be seen that in the present scheme, when generating the target skeleton list, the skeleton list of multiple target skeleton titles of predetermined level can be generated, i.e.the skeleton list of multiple target skeleton titles of the level required by the user can be generated.The problem that the corresponding skeleton list cannot be generated according to the skeleton title viewing requirement of the user in the prior art, and the user experience is poor, can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for extracting document outlines. Background Technology

[0002] To help readers quickly understand the content of a document from a large amount of data, it is usually necessary to extract a document outline, so that readers can understand the content of the document based on the outline.

[0003] In existing technologies, when extracting outlines from a target document, the target document is traversed, outline titles are extracted from the target document based on a preset regular expression, and the extracted outline titles are sorted to obtain an outline list of the target document.

[0004] However, target documents typically contain multiple levels of outlines, such as: Level 1: First, Second; Level 2: Part 1, Part 2; Level 3: 1, 2, etc. In practical applications, users may only want to view an outline list consisting of the headings from a subset of levels, for example, only the headings from the first and second levels. The outline list obtained using existing technologies is composed of all the headings extracted from the target document, and cannot generate a corresponding outline list based on the user's specific heading requirements, resulting in a poor user experience. Summary of the Invention

[0005] The purpose of this invention is to provide a method, apparatus, electronic device, and storage medium for extracting document outlines, thereby solving the problem of not being able to generate a corresponding outline list based on the user's outline title viewing requirements. The specific technical solution is as follows:

[0006] In a first aspect, embodiments of the present invention provide a method for generating an outline list, including:

[0007] Retrieve multiple outline headings from the target document;

[0008] Based on the naming structure of the multiple outline headings and their positional order in the target document, the level to which the multiple outline headings belong is determined;

[0009] Multiple target outline titles belonging to a predetermined level are merged according to the order of the levels to obtain a target outline list.

[0010] Optionally, obtaining multiple outline headings from the target document includes:

[0011] Extract multiple paragraphs from the target document sequentially according to their positional order within the target document;

[0012] For each paragraph, identify the sentence that appears at the beginning of the paragraph as the target sentence;

[0013] From the identified target sentences, determine multiple outline headings.

[0014] Optionally, determining multiple outline headings from the identified multiple target sentences includes:

[0015] Based on a predetermined regular expression, outline headings are matched from multiple identified target sentences; wherein the predetermined regular expression is one or more, and each regular expression is used to match outline headings with a naming structure.

[0016] Optionally, obtaining multiple outline headings from the target document includes:

[0017] Extract multiple outline headings from the target document and record the positions of the outline headings in the target document;

[0018] The outline headings are grouped according to their naming structure to obtain multiple outline heading groups;

[0019] According to the position of the outline titles in the target document, the outline titles in each outline title group are sorted to obtain multiple sorted outline title groups.

[0020] Optionally, the step of extracting multiple outline headings from the target document and recording the positions of the outline headings in the target document includes:

[0021] Based on multiple predefined regular expressions, multiple outline headings are extracted from the target document, and the positions of the outline headings in the target document are recorded. Each regular expression is used to match outline headings with a naming structure.

[0022] Optionally, each predetermined regular expression includes three components: a start part, a numeric part, and an end part. Each component contains element values ​​that match that component, and the element values ​​of the numeric part are not empty.

[0023] Optionally, the hierarchy to which the outline headings belong is determined based on their naming structure and positional order in the target document, including:

[0024] The outline title at the beginning of the target document, and the outline titles with the same naming structure as the beginning outline title, are taken as the outline titles corresponding to the highest level.

[0025] Optionally, determining the level to which each outline title belongs based on its naming structure and its position in the target document further includes:

[0026] From the currently determined levels, find the lowest level to obtain the current level;

[0027] Determine the naming structure of the next level of the current level, wherein the naming structure of the next level is the naming structure corresponding to the outline title located one position after the first outline title in the target document and which is different from the naming structure of the first outline title; wherein the first outline title is the outline title belonging to the current level.

[0028] The outline heading group corresponding to the naming structure of the next level is used as the outline heading group corresponding to the next level.

[0029] Optionally, multiple target outline titles belonging to a predetermined level are merged according to the order of the levels to obtain a target outline list, including:

[0030] From the multiple outline heading groups, determine multiple outline heading groups belonging to a predetermined level to obtain multiple target outline heading groups;

[0031] For each target outline title in each target outline title group, determine the base outline title corresponding to each target outline title; wherein, the base outline title corresponding to the target outline title is the outline title corresponding to the next higher level of the target outline title;

[0032] Based on the positional order of each target outline title in the target document, the target outline titles are merged into each baseline outline title to obtain the outline list of the target document.

[0033] Optionally, determining the level to which the outline title belongs based on its naming structure and its position in the target document includes:

[0034] The outline title at the beginning of the target document, and the outline titles with the same naming structure as the beginning outline title, are taken as the outline titles corresponding to the highest level.

[0035] Optionally, determining the level to which each outline title belongs based on its naming structure and its position in the target document further includes:

[0036] From the currently determined levels, find the lowest level to obtain the current level;

[0037] Determine the naming structure of the next level below the current level, wherein the naming structure of the next level is the naming structure corresponding to the outline title located one position after the first outline title in the target document and whose naming structure is different from that of the first outline title; wherein the first outline title is the outline title belonging to the current level.

[0038] If the first outline title is not the last outline title of the current level, the outline title located between the first outline title and the second outline title in the target document and having the naming structure of the next level is determined as the outline title corresponding to the next level. The second outline title is an outline title that belongs to the same level as the first outline title and is adjacent to the first outline title.

[0039] If the first outline title is the last outline title of the current level, then the outline title in the target document that is located after the first outline title and has the naming structure of the next level is determined as the outline title corresponding to the next level.

[0040] Optionally, the method further includes: attaching a pattern identifier to each outline title; wherein the pattern identifier is a unique identifier corresponding to a regular expression that matches the outline title, and outline titles with the same pattern identifier are outline titles with the same naming structure.

[0041] Optionally, the process of merging multiple target outline titles belonging to a predetermined level according to the order of the levels to obtain a target outline list includes:

[0042] From the multiple outline headings, determine multiple outline headings belonging to a predetermined level to obtain multiple target outline headings;

[0043] For each target outline title, a base outline title corresponding to the target outline title is determined; wherein, the base outline title corresponding to the target outline title is the target outline title corresponding to the next higher level of the target outline title;

[0044] Based on the position of the target outline title in the target document, the target outline title is merged between each baseline outline title or after the last baseline outline title to obtain the outline list of the target document.

[0045] Optionally, before obtaining the multiple outline headings in the target document, the method further includes:

[0046] A predetermined level is determined, which is the level to be integrated into the target outline list.

[0047] Secondly, embodiments of the present invention provide a method for generating an outline list, applied to an electronic device, comprising:

[0048] Receive user actions for the target document;

[0049] In response to the user operation, a target outline list for the target document is generated, wherein the target outline list is generated by the outline list generation method described in any of the preceding claims;

[0050] The first page is displayed, which shows the list of the target outlines.

[0051] Thirdly, embodiments of the present invention provide an apparatus for generating an outline list, comprising:

[0052] The outline acquisition module is used to acquire multiple outline titles from a target document, wherein the acquired multiple outline titles are ordered according to their position in the target document;

[0053] The hierarchy determination module is used to determine the hierarchy to which the multiple outline headings belong based on their naming structure and their positional order in the target document.

[0054] The outline fusion module is used to merge multiple target outline titles belonging to a predetermined level according to the order of the level to obtain a target outline list.

[0055] Fourthly, embodiments of the present invention provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0056] Memory, used to store computer programs;

[0057] When a processor executes a program stored in memory, it implements the steps of a method for generating an outline list provided in an embodiment of the present invention.

[0058] Fifthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of a method for generating an outline list provided in embodiments of the present invention.

[0059] Beneficial effects of the embodiments of the present invention:

[0060] The solution provided by this invention involves obtaining multiple outline titles from a target document, wherein the obtained multiple outline titles are sorted according to their positional order in the target document; based on the naming structure of the outline titles and their positional order in the target document, the level to which the outline titles belong is determined; and the multiple outline titles belonging to the predetermined level are merged according to the order of the levels to obtain a target outline list. Therefore, this solution can generate an outline list of multiple target outline titles at a predetermined level when generating the target outline list, that is, it can generate an outline list of multiple target outline titles at the level required by the user. This solves the problem of existing technologies that cannot generate corresponding outline lists based on the user's outline title viewing needs, resulting in a poor user experience.

[0061] Of course, implementing any product or method of the present invention does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description

[0062] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.

[0063] Figure 1 This is a flowchart illustrating a method for generating an outline list according to an embodiment of the present invention;

[0064] Figure 2 This is another flowchart of a method for generating an outline list according to an embodiment of the present invention;

[0065] Figure 3 This is another flowchart of a method for generating an outline list according to an embodiment of the present invention;

[0066] Figure 4 This is a schematic diagram of the structure of a document outline extraction device according to an embodiment of the present invention;

[0067] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

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

[0069] To address the issue of being unable to generate a corresponding outline list based on the user's outline title viewing requirements, embodiments of the present invention provide a method, apparatus, electronic device, and storage medium for generating an outline list.

[0070] It should be noted that the outline list generation method provided in this embodiment of the invention can be applied to electronic devices. In practical applications, the electronic device can be a smartphone, tablet computer, laptop computer, etc., which are all reasonable. Specifically, the executing entity of the outline list generation method provided in this embodiment of the invention can be a plugin for office software running on the electronic device, such as a plugin for Word document software, a plugin for WPS document software, etc., or it can be application software running on the electronic device that extracts document outlines.

[0071] The document addressed in this embodiment of the invention can be any electronic document, such as an editorial in the People's Daily. Each electronic document may contain multiple outline headings, which can generate a corresponding outline list. Each outline heading includes its heading number and the outline text. For example, the outline list could be: First, Test 1; Firstly, Test 2; Secondly, Test 3. Then, "First, Test 1," "Firstly, Test 2," and "Secondly, Test 3" are the multiple outline headings constituting this outline list, "First," "Firstly," and "Secondly" are the heading numbers of these headings, and "Test 1," "Test 2," and "Test 3" are the outline text.

[0072] In addition, in this embodiment, each outline number can also satisfy a predetermined naming structure. It should be noted that the naming structure of the outline titles mentioned below refers to the same concept as the naming structure of the outline numbers.

[0073] For example, suppose a document contains multiple outline headings with the following heading numbers: First, Second, One, Two, (I) and (II), wherein the outline heading containing First and the outline heading containing Second have the same naming structure, the outline heading containing One and the outline heading containing Two have the same naming structure, and the outline heading containing (I) and the outline heading containing (II) have the same naming structure.

[0074] Furthermore, in the electronic document of this embodiment, each outline title corresponds to a level, and each level of outline title can correspond to one or more naming structures, that is, each level of outline title can include multiple title sequences. For example, the outline list of the target document is: First, Test. 1. Test. 2. Test; Second, Test. Firstly, Test. Secondly, Test; Third, Test. 1. Test. 2. Test. Then, in this outline list, the outline titles of the first level are: "First, Test", "Second, Test" and "Third, Test", that is, the outline titles of the first level correspond to one naming structure. The outline titles of the second level are: "Firstly, Test", "Second, Test", "1. Test" and "2. Test", that is, the outline titles of the second level correspond to two naming structures, and so on.

[0075] The hierarchical relationship of a document outline can be from high to low. Furthermore, for multiple outline headings belonging to the same level, each heading within that level can contain multiple lower-level headings. For example, if the first level is the highest level, and the second and third levels are lower levels, and the first level contains headings such as "first," "second," and "third," the second level contains headings such as "(a)," and "(b)," then the hierarchical relationship of the document outline can be: first level, second level, third level. Between the first and second headings of the first level, there can be lower-level headings such as "(a)," "(b)," and "(b)."

[0076] The method for generating an outline list provided in this embodiment of the invention may include the following steps:

[0077] Obtain multiple outline headings from a target document, wherein the obtained multiple outline headings are ordered according to their position in the target document;

[0078] Based on the naming structure of the outline titles and their positional order in the target document, the level to which the outline titles belong is determined;

[0079] Multiple target outline titles belonging to a predetermined level are merged according to the order of the levels to obtain a target outline list.

[0080] As can be seen, this solution can generate outline lists of multiple target outline titles at a predetermined level when generating the target outline list, that is, it can generate outline lists of multiple target outline titles at the level required by the user. This solves the problem of existing technologies being unable to generate corresponding outline lists based on the user's outline title viewing needs, resulting in a poor user experience.

[0081] The following describes a method for generating an outline list according to an embodiment of the present invention, with reference to the accompanying drawings.

[0082] like Figure 1 As shown, the method for generating an outline list provided by an embodiment of the present invention may include the following steps:

[0083] S101, retrieve multiple outline headings from the target document;

[0084] In one embodiment, the acquired outline headings are sorted according to their position in the target document. Positional order refers to the order in which the outline headings are ordered based on their location within the target document. Furthermore, the sorting of the acquired outline headings can be performed before, after, or during the acquisition of the outline headings from the target document; all are reasonable. This embodiment of the invention does not specifically limit the sorting method for the outline headings. For example, each outline heading can be digitized according to its position in the target document, and then sorted based on this digitized number, etc.

[0085] It is understandable that any electronic document that requires the generation of a document outline list can be used as the target document. Within the target document, each outline title can correspond to a naming structure, and multiple outline titles can belong to the same naming structure.

[0086] There are several ways to obtain multiple outline headings from a target document, such as obtaining them according to extraction rules or by paragraph.

[0087] 1. Obtain according to the extraction rules

[0088] For example, in one implementation, obtaining multiple outline titles from a target document may include: determining extraction rules based on the naming structure of the multiple outline titles, and extracting the multiple outline titles from the target document according to the extraction rules. Each naming structure corresponds to one extraction rule. The extraction rules can be represented using predefined regular expressions. Furthermore, when using regular expressions to obtain outline titles from the target document, the position of each outline title in the target document can also be recorded simultaneously, and the extracted outline titles can be sorted according to their position order in the target document to obtain multiple outline titles sorted according to their position order in the target document.

[0089] 2. Obtain by paragraph

[0090] For example, in another implementation, obtaining multiple outline headings in a target document may include: extracting multiple paragraphs from the target document sequentially according to their position in the target document; identifying the sentence at the beginning of each paragraph as the target sentence; and determining multiple outline headings from the identified target sentences.

[0091] Understandably, a target document typically contains multiple paragraphs, and the outline titles can be the sentences at the very beginning of those paragraphs. The first sentence can represent the first sentence of that paragraph, and can be a string ending with a period, carriage return, or other similar symbol. Therefore, when retrieving multiple outline titles from a target document, we can extract multiple paragraphs sequentially according to their position within the document, and identify the first sentence in each paragraph to determine the multiple outline titles. This way, after determining the multiple outline titles, the extraction order of these titles matches their position order within the target document.

[0092] Given that there can be multiple naming structures for these multiple outline headings, there can be multiple ways to determine the implementation of multiple outline headings from the identified multiple target sentences.

[0093] For example, in one implementation, determining multiple outline headings from the identified multiple target sentences may include: matching outline headings from the identified multiple target sentences according to a predetermined regular expression; wherein the predetermined regular expression is one or more, and each regular expression is used to match outline headings of a naming structure.

[0094] The form of the predefined regular expression can be various. For example, in one implementation, each predefined regular expression includes three components: a start part, a numeric part, and an end part. Each component contains element values ​​that match that component, and the element values ​​of the numeric part are not empty.

[0095] Understandably, for ease of description, these multiple predefined regular expressions can, for example, take the form: startpattern + numberpattern + endpattern. Accordingly, startpattern corresponds to the starting part, numberpattern corresponds to the number part, and endpattern corresponds to the ending part.

[0096] For example, the multiple types of element values ​​contained in each part can be:

[0097] numberpattern = ['[one, two, three, four, five, six, seven, eight, nine, ten]+', '[1-9][0-9]?']

[0098] startpattern = ['[' + flag + ']' for flag in '((第其']

[0099] endpattern = ['[' + flag + ']' for flag in '..,,、))是要']

[0100] Among them, the element values between the two characters "[]" are in an "or" relationship, and as long as any one of them appears once, it can be matched.

[0101] Among them, the character "?" indicates that the number of occurrences of the element value or expression before the "?" can be one or zero times. For example: Suppose the regular expression is "colou?r", then the "?" means that the number of occurrences of "u" is one or zero times, that is, this regular expression can be used to match two strings: "color" or "colour".

[0102] Among them, flag is the target element value to be matched. For example: "for flag in '((第其'" means that any element value from "((第其" can be regarded as the target element value flag to be matched.

[0103] Among them, the character "+" indicates that the number of occurrences of the element value before the "+" is one or more times. For example, "[one, two, three, four, five, six, seven, eight, nine, ten]+" means that the number of occurrences of any element value in "[one, two, three, four, five, six, seven, eight, nine, ten]" is one or more times. It can match the case of appearing once, such as "one", "two" or "three", etc.; it can also match the case of appearing multiple times, such as "eleven", "twelve" or "thirteen", etc.

[0104] Exemplarily, assume that the outline titles of the target document include: First, test; Second, test; Firstly, test; Secondly, test. Then, when extracting the outline titles of the target document, the element value "Di" (Chinese for "First") at the beginning part of the predetermined regular expression can match the "Di" in "First, test" and "Second, test"; the element value "Qi" (Chinese for "First") can match "Firstly, test" and "Secondly, test". In this way, when the beginning part can match specific element values, the element values of the numerical part are matched, and after the specific element values are matched in the numerical part, the element values of the ending part are matched. In the embodiments of the present invention, the adopted predetermined regular expression includes three types of components: the beginning part, the numerical part, and the ending part. Each type of component contains multiple types of element values that match this part. When extracting outline titles, it can cover the naming structures of each outline title in the document, thereby improving the comprehensiveness of title extraction.

[0105] Exemplarily, in another implementation, the multiple predetermined regular expressions may include: Formula 1: [Di]([YiErSanSiWuLiuQi]+[,]; Formula 2: [1-9]?[0-9][.]; Formula 3: [1-9]?[0-9][]. Among them, Formula 1 can be used to match outline titles such as "First, test", "Second, test", and "Third, test";... Then, correspondingly, in another implementation, according to the multiple predetermined regular expressions, to match multiple outline titles from the identified multiple target sentences may include: for each target sentence, successively use Formula 1, Formula 2, and Formula 3 for identification until a match can be made or all formulas have been used. Thus, multiple outline titles are matched from the identified multiple target sentences.

[0106] To meet the outline list generation requirements of different users, the number of the predetermined regular expressions can also be one. Then, when the predetermined regular expression is one, all types of naming structure outline titles can be obtained from the target document at one time, and the obtained outline titles are sorted in the order of their positions in the target document.

[0107] Exemplarily, in one implementation, when the predetermined regular expression is one, the predetermined regular expression can be: [DiQi]?([YiErSanSiWuLiuQiBaJiuShi]+|[1-9]?[0-9])[.)]?.

[0108] It should be noted that since one predetermined regular expression is used to extract all types of naming structure outline titles in the target document, the extracted outline titles are sorted in the order of their positions in the target document.

[0109] S102, based on the naming structure of the multiple outline headings and their positional order in the target document, determine the level to which the multiple outline headings belong.

[0110] Each outline title must include at least its title number in its naming structure. For example, "1" in "1 Test", "2" in "2 Test", "First" in "First Test", and "Second" in "Second Test", etc.

[0111] Furthermore, in order to meet users' requests for generating lists of outline titles at different levels, after obtaining multiple outline titles from the target document, the level to which each outline title belongs can be determined.

[0112] For example, in one implementation, determining the level to which the multiple outline titles belong based on their naming structure and positional order in the target document may include: taking the outline title that appears first in the target document, and the outline title with the same naming structure as the first outline title, as the outline title corresponding to the highest level.

[0113] For example, in another implementation, determining the hierarchy of the multiple outline headings based on their naming structure and positional order in the target document may further include:

[0114] From the currently determined levels, find the lowest level to obtain the current level;

[0115] Determine the naming structure of the next level of the current level, wherein the naming structure of the next level is the naming structure corresponding to the outline title located one position after the first outline title in the target document and which is different from the naming structure of the first outline title; wherein the first outline title is the outline title belonging to the current level.

[0116] The outline title located between the first outline title and the second outline title in the target document, and having the naming structure of the next level, is determined as the outline title corresponding to the next level, wherein the second outline title is an outline title of the same level as the first outline title and adjacent to the first outline title.

[0117] Understandably, to improve the accuracy of hierarchy determination, the outline titles are determined sequentially according to their position in the target document. For example, the outline title appearing first in the target document is taken as the outline title corresponding to the highest level. After determining the outline title corresponding to the highest level, the outline titles adjacent to that highest level are taken as the outline titles corresponding to the second level, and so on. "Adjacent to the outline title corresponding to the highest level" can be understood as meaning that the outline titles are sequentially adjacent in the target document.

[0118] For example, when it is necessary to determine the outline title corresponding to the third level, we can find the lowest level, i.e., the second level, from the currently determined levels, and use the second level as the current level, and then determine the remaining levels in turn.

[0119] Considering that the outline title of the next level below the current level often follows the outline title of the current level, when determining the next level below the current level, the outline title between the first and second outline titles of the current level, and which immediately follows the first outline title in the target document, can be determined as the outline title of the next level.

[0120] S103, merge multiple target outline titles belonging to a predetermined level according to the order of that level to obtain a target outline list.

[0121] In this document, outline headings are organized hierarchically, with lower-level headings nested within or following higher-level headings. The order of these hierarchical levels refers to the arrangement of the headings from the highest to the lowest level; that is, they can be arranged in the order of first level, second level, third level, and so on. The second level is nested within the first level, and the third level is nested within the second level.

[0122] It is important to note that the specific execution process of steps S102 and S103 can be as follows: S102 can be executed first, followed by S103. That is, first determine the level to which each outline title belongs, and then merge multiple target outline titles belonging to the predetermined level according to the order of that level to obtain a target outline list. Alternatively, steps S102 and S103 can be executed alternately. That is, for each outline title, after determining the level of the outline title in step S102, step S103 is executed to identify whether the outline title belongs to the predetermined level of the target outline title. If it does, then merge according to the level of the target outline title; if not, then ignore the outline title and continue to determine the level of the next outline title in step S102, until all target outline titles belonging to the predetermined level are merged to obtain a target outline list.

[0123] In addition, the fusion process involves adding the target outline titles to the target outline list. After the fusion is completed, the final target outline list is obtained.

[0124] Furthermore, these multiple target outline titles can be a subset of all outline titles in the acquired target document, or they can be all outline titles. In other words, to meet users' needs for generating lists of outline titles at different levels, multiple outline titles belonging to a predetermined level can be selected from multiple outline titles when generating the outline list. This predetermined level can be a level selected by the user; of course, if the user does not select a level, the predetermined level can be a default level, such as all levels, or the level selected when the outline list was last generated, which is also reasonable.

[0125] Furthermore, there are multiple ways to allow users to select the level of the outline list to be generated. For example, users can click a function button on the outline list generation interface to bring up a level selection dialog box. In this embodiment of the invention, the specific form of the function button is not limited; for example, the function button can be a drop-down menu or a shortcut key, etc.

[0126] For example, in one implementation, multiple target outline titles belonging to a predetermined level are merged according to the order of that level to obtain a target outline list, which may include:

[0127] From these multiple outline headings, identify multiple outline headings belonging to a predetermined level to obtain multiple target outline headings;

[0128] For each target outline title, determine the corresponding baseline outline title; wherein, the baseline outline title corresponding to the target outline title is the target outline title at the next higher level of the target outline title.

[0129] Based on the position of the target outline title in the target document, merge the target outline title between each baseline outline title or after the last baseline outline title to obtain the outline list of the target document.

[0130] To facilitate the merging of multiple target outline titles, during the merging process, the target outline title corresponding to the next level above each target outline title, i.e., the baseline outline title, can be determined and merged between the baseline outline titles or after the last baseline outline title.

[0131] Of course, when merging target outline titles, you can merge the outline titles corresponding to each level in a hierarchical order. For example, you can first sort and merge multiple target outline titles belonging to the highest level, such as the first level, according to their position in the target document, and then merge the target outline titles corresponding to the second level after merging.

[0132] Furthermore, for example, during fusion, multiple target outline titles that are already sorted and belong to the same level can be merged as a whole. For example, suppose all outline titles in the target document, in the order of their appearance in the target document, are: First, Test; First, Test; Second, Test; Second, Test; First, Test X; 1, Test; 2, Test; Second, Test X; Third, Test; First, Test; Second, Test. The level of each outline title can be determined according to step S102. For example, the target outline titles included in the first level are determined to be: First, Test; Second, Test; Third, Test. The target outline titles included in the second level are: First, Test; Second, Test; First, Test X; Second, Test X. Therefore, when merging the target outline titles corresponding to the second level, the already sorted second-level titles "First, Test; Second, Test" and "First, Test X; Second, Test X" can be merged as a whole between "First, Test" and "Second, Test," and between "Second, Test" and "Third, Test," respectively. Furthermore, since "Third, Test" is the last baseline outline title, the subsequent "First, Test" and "Second, Test" will be merged after "Third, Test." Further, if the predetermined levels only include the first and second levels, then "First, Test X" and "Second, Test X," as outline titles of the third level, will not be merged into the target outline list.

[0133] As can be seen, this solution can generate outline lists of multiple target outline titles at a predetermined level when generating the target outline list, that is, it can generate outline lists of multiple target outline titles at the level required by the user. This solves the problem of existing technologies being unable to generate corresponding outline lists based on the user's outline title viewing needs, resulting in a poor user experience.

[0134] Optionally, in another embodiment of the present invention, the outline list generation method may further include:

[0135] When or after extracting outline titles, a pattern identifier is attached to each outline title; the pattern identifier is a unique identifier corresponding to the regular expression that matches the outline title, and outline titles with the same pattern identifier are outline titles with the same naming structure.

[0136] In this embodiment of the invention, the form of the pattern identifier is not specifically limited. For example, the pattern identifier can be in the form of numbers, such as 1, 2, 3, etc., or in the form of letters, such as A, B, C, a, b, c, etc.

[0137] Optionally, before retrieving multiple outline headings from the target document, the method may further include:

[0138] Determine the predetermined level, which is the level to be integrated into the target outline list. This predetermined level can be a user-specified level or a default level, etc.

[0139] For clarity, this embodiment will use a specific example to illustrate the complete method flow.

[0140] The outline list generation method provided in this embodiment of the invention may include the following steps (1)-(5):

[0141] (1) Based on the preset paragraph extraction conditions, extract paragraphs from the target document and generate a paragraph list by arranging the extracted paragraphs in the order of their positions in the target document.

[0142] In one embodiment, the preset paragraph extraction conditions may include one or more of the following: paragraph length, missing punctuation marks, and minimum number of sentences in a paragraph. This embodiment of the invention does not limit the specific implementation process of paragraph extraction from the target document. For example, it may employ a Word to Vector (Word2Vec) model, a TextCNN model, and an attention model to extract paragraphs from the target document. The attention model is used to score paragraphs, with scores ranging from 0 to 1 or from 0 to 100, etc. A higher score indicates a higher probability that the corresponding text is a paragraph.

[0143] For example, paragraph scoring can employ a batch processing operation on a paragraph-by-paragraph basis. For instance, in a single paragraph scoring process: after jieba word segmentation, the word representations of the paragraph are obtained. These are then vectorized using a Word2Vec model pre-trained on high-quality graphs, resulting in a word vector representation (representation feature map) for each paragraph. An attention operation is performed before convolution, using the attention matrix to calculate the attention representation (attention feature map) for the corresponding paragraph. This attention feature map, along with the paragraph representation (representation feature map), is input into the convolutional layer. The convolution result is then pooled and subjected to a pre-defined normalization (such as Softmax) to obtain the final score.

[0144] The Softmax solution formula includes: Where z represents the value of each element, k represents the total number of element types, i represents the current element, and a represents the score. The Attention operation can be divided into three parts: weight association, parameter normalization, and weighted summation. This invention employs a dot product operation for the weight association part, obtaining the weights of the Attention matrix, which are then normalized using Softmax. A weighted summation is then performed with the input data to obtain the Attention map. This map, combined with the input data, yields the final output result after Attention, which is then processed by subsequent steps.

[0145] Of course, in another embodiment, all paragraphs in the target document can also be extracted without additional extraction criteria to achieve the filtering operation.

[0146] (2) Identify the first sentence of each paragraph in the order of the paragraph list. Then, try to match the outline title from the identified first sentence using multiple predefined regular expressions. If a regular expression can match the outline title from the first sentence, record the pattern ID of the regular expression corresponding to the matched outline title.

[0147] The predetermined regular expressions are as described in the above embodiments. For example, the matching result of the outline titles corresponding to the paragraph list can be: (Part I, Test, 3), (I, Test X, 2), (1, Test, 4), (2, Test, 4), (II, Test X, 2), (Part II, Test, 3), (I, Test X, 2), (II, Test X, 2), (First, Test, 8), (Third, Test, 3), (I, Test Y, 2), (II, Test Y, 2), (1, Test, 4), (2, Test, 4). The number following each outline title in parentheses is the pattern ID corresponding to that outline title. For example, the pattern ID corresponding to the outline title "Part I, Test" is 3, and the pattern ID corresponding to "I, Test X" is 2, etc.

[0148] It is understandable that when matching outline titles, the matching is performed sequentially according to the order of their positions in the target document. Therefore, the matched outline titles can also be sorted according to their order of positions in the target document.

[0149] (3) Find the outline title that appears first, and take the pattern ID corresponding to the first outline title as the pattern ID corresponding to the first-level outline title. Then take all the outline titles corresponding to the pattern ID as the outline titles corresponding to the first-level outline.

[0150] For example, assuming that the outline title with pattern ID 3 appears first, then all outline titles with pattern ID 3 will be treated as first-level outline titles. For example: (First Test, 3), (Second Test, 3), (Third Test, 3) are first-level outline titles.

[0151] (4) Find the outline title that immediately follows the first-level outline title and has a different pattern ID from the first-level outline title. Record the pattern ID corresponding to this second-level outline title. Between two adjacent first-level outline titles, search for all outline titles with the pattern ID corresponding to this second-level outline title. Insert these second-level outline titles between the two adjacent first-level outline titles. When the first-level outline title is the last one, search for all outline titles with the pattern ID corresponding to this second-level outline title after this last first-level outline title. Insert these second-level outline titles after this last first-level outline title.

[0152] For example, assuming that the outline title (I. Test X, 2) is in the second position and appears immediately after the first-level outline title (I. Test, 3), then all outline titles with pattern id 2 located between the first-level outline titles (I. Test, 3) and (II. Test, 3) will be used as second-level outline titles, i.e., (I. Test X, 2), (II. Test X, 2). Then, these second-level outline titles will be inserted between the first-level outline titles (I. Test, 3) and (II. Test, 3), resulting in: (I. Test, 3), (I. Test X, 2), (II. Test X, 2), (II. Test, 3), (III. Test, 3). Similarly, the search can find the second-level outline headings between the first-level outline heading (Second Test, 3) and the first-level outline heading (Third Test, 3) as (I. Test X, 2) and (II. Test X, 2). The inserted result is: between (First Test, 3) and the first-level outline heading (Second Test, 3), the result can be: (First Test, 3), (First Test X, 2), (Second Test X, 2), (Second Test, 3), (First Test X, 2), (Second Test X, 2), (Third Test, 3). Similarly, the second-level outline headings following the last first-level outline heading (Test 3, 3) are (Test 1, Y, 2) and (Test 2, Y, 2). After insertion, the result between (Test 1, 3) and the first-level outline heading (Test 2, 3) can be: (Test 1, 3), (Test 1, X, 2), (Test 2, X, 2), (Test 2, 3), (Test 1, X, 2), (Test 2, X, 2), (Test 3, 3) (Test 1, Y, 2), (Test 2, Y, 2).

[0153] (5) If the predetermined levels only include level 1 and level 2, the final result above will be output as the target outline list; if the predetermined levels also include level 3, the search for level 3 outline titles will continue in a similar manner to the search for level 2 outline titles above, and the titles will be inserted until all predetermined levels have been inserted, and the final result will be output as the target outline list.

[0154] The above implementation methods are applicable to both cases where a single naming structure is used at the same level and cases where multiple naming structures are used at the same level. The following will describe an implementation method that is applicable to cases where a single naming structure is used at the same level and is simpler to implement.

[0155] Specifically, such as Figure 2 As shown, the above steps S101-S103 can be further refined into the following steps S110-S170:

[0156] S110. Extract multiple outline headings from the target document and record the positions of the outline headings in the target document.

[0157] In this embodiment, multiple outline headings can be extracted from the target document based on multiple predetermined regular expressions, and the positions of the outline headings in the target document can be recorded. Each regular expression is used to match an outline heading with a naming structure.

[0158] In one embodiment, the multiple predetermined regular expressions may take various forms. For example, in one implementation, each predetermined regular expression includes three components: a start part, a numeric part, and an end part. Each component contains element values ​​that match that component, and the element values ​​of the numeric part are not empty.

[0159] Understandably, for ease of description, these multiple predefined regular expressions can, for example, take the form: startpattern + numberpattern + endpattern. Accordingly, startpattern corresponds to the starting part, numberpattern corresponds to the number part, and endpattern corresponds to the ending part.

[0160] Furthermore, when using regular expressions to match an outline title, the position of that outline title in the target document can also be recorded. For example, the position can be recorded as the outline title starting from the Nth character to the Mth character in the target document, where N and M are positive integers. Another example is that the position can be recorded as the outline title starting from the Nth character in the target document and having a total length of T. For instance, when matching the phrase "this outline title," it can be recorded as (5, 8) or (5, 4), where 5 indicates that "the outline title" starts from the 5th character in "this outline title"; 8 indicates that "the outline title" ends from the 8th character in "this outline title"; and 4 indicates that the string "the outline title" contains 4 characters, meaning the total length of the string is 4.

[0161] S120. The outline titles are grouped according to the naming structure to obtain multiple outline title groups.

[0162] In one embodiment, a pattern identifier is attached to each outline title when or after the outline titles are extracted; wherein the pattern identifier is a unique identifier corresponding to a regular expression that matches the outline title, and outline titles with the same pattern identifier are outline titles with the same naming structure.

[0163] In this embodiment of the invention, the form of the pattern identifier is not specifically limited. For example, the pattern identifier can be in the form of numbers, such as 1, 2, 3, etc., or in the form of letters, such as A, B, C, a, b, c, etc.

[0164] Furthermore, outline headings with the same pattern identifier can be considered to use the same naming structure. In other words, outline headings with the same pattern identifier can be grouped into the same outline heading group.

[0165] S130. Sort the outline titles in each outline title group according to their positions in the target document to obtain a plurality of sorted outline title groups.

[0166] In one embodiment, the outline headings can be sorted according to their position in the target document. In another embodiment, they can also be sorted according to their serial numbers within the outline headings.

[0167] S140. Based on the naming structure of the multiple outline headings and their positional order in the target document, determine the level to which the multiple outline headings belong.

[0168] Specifically, multiple outline heading groups can include the following two situations: the outline heading group corresponding to the highest level and the outline heading group corresponding to the lowest level.

[0169] 1. The outline heading group corresponding to the highest level

[0170] In this embodiment, the outline title group containing the first outline title in the target document is taken as the outline title group corresponding to the highest level.

[0171] 2. Lower-level corresponding outline heading groups

[0172] In this embodiment, the lowest level outline heading group is found from the currently determined outline heading group to obtain the outline heading group of the current level.

[0173] Determine the naming structure of the next level below the current level, wherein the naming structure of the next level is the naming structure corresponding to the outline title located after the first outline title in the target document and whose naming structure is different from that of the first outline title; wherein the first outline title is the outline title belonging to the outline title group of the current level.

[0174] The outline heading group corresponding to the naming structure of the next level is used as the outline heading group corresponding to the next level.

[0175] S150. From the plurality of outline heading groups, determine a plurality of outline heading groups belonging to a predetermined level to obtain a plurality of target outline heading groups.

[0176] The multiple target outline heading groups can be a subset of all outline heading groups in the acquired target document, or they can be all outline heading groups. In other words, to meet users' needs for generating lists of outline headings at different levels, multiple outline heading groups belonging to a predetermined level can be selected from multiple outline heading groups when generating the outline list. This predetermined level can be a level selected by the user; however, if the user does not select a level, the predetermined level can be a default level, such as all levels, or the level selected during the last outline list generation—both are reasonable.

[0177] Furthermore, there are multiple ways to allow users to select the level of the outline list to be generated. For example, users can click a function button on the outline list generation interface to bring up a level selection dialog box. In this embodiment of the invention, the specific form of the function button is not limited; for example, the function button can be a drop-down menu or a shortcut key, etc.

[0178] S160. For each target outline title in each target outline title group, determine the base outline title corresponding to each target outline title; wherein, the base outline title corresponding to the target outline title is the outline title corresponding to the next higher level of the target outline title.

[0179] S170. Based on the positional order of each target outline title in the target document, merge the target outline titles into each baseline outline title to obtain the outline list of the target document.

[0180] In one embodiment, after determining the positional order of each target outline title in the target document, the relative positional relationship between each target outline title and each baseline outline title can also be determined. This relative positional relationship can determine whether a target outline title follows a certain outline title, and it can also determine which two baseline outline titles the target outline title is located between. Furthermore, based on the determined relative positional relationship, the target outline titles can be merged after the baseline outline titles that have a relative positional relationship with the target outline titles.

[0181] For example, suppose all the outline headings of the target document are in the following order of appearance in the target document: (i) Test; (1) Test; (2) Test; (3) Test; (ii) Test; (iii) Test; (1) Test; (2) Test.

[0182] First, extract the outline headings from the target document in the order they appear, and record the position of each heading in the target document.

[0183] Secondly, the outline titles are grouped according to the naming structure. "(I), Test; (II), Test; (III), Test" is grouped into one group, and "(1), Test; (2), Test; (3), Test, and (1), Test; (2), Test" is grouped into another group. Based on the recorded position of each outline title in the target document, "(I), Test" is determined to be the outline title corresponding to the first-level outline (highest level). Then, "(1), Test; (2), Test; (3), Test, and (1), Test; (2), Test" are the outline titles corresponding to the second-level outlines.

[0184] Next, insert the outline titles corresponding to the second-level outlines into the outline titles corresponding to the first-level outlines, resulting in: (I) Test; (1) Test; (2) Test; (3) Test;

[0185] (II) Testing;

[0186] (III) Test; (1) Test; (2) Test.

[0187] Among them, the three target outline titles “(1), Test; (2), Test; (3), Test” have a relative positional relationship with the two benchmark outline titles “(I), Test” and “(II), Test”. The three target outline titles “(1), Test; (2), Test; (3), Test” can be merged between the two benchmark outline titles “(I), Test” and “(II), Test”, that is, after the benchmark outline title “(I), Test”. The two target outline titles “(1), Test; (2), Test” have a relative positional relationship with the benchmark outline title “(III). The two target outline titles “(1), Test; (2), Test” can be merged after the benchmark outline title “(III), Test”.

[0188] It is understandable that since “(1), test; (2), test; (3), test” and “(1), test; (2), test” can be divided into two groups according to their positions in the target document, the contents of each group can be sorted according to the numerical pattern to obtain the final list of outline titles.

[0189] The following describes a method for generating an outline list provided by an embodiment of the present invention from the perspective of the executing entity being an electronic device.

[0190] like Figure 3 As shown, the outline list generation method provided in this embodiment of the invention, applied to electronic devices, may include:

[0191] S201, Receive user operations for the target document;

[0192] S202, in response to the user operation, generate a target outline list for the target document;

[0193] Wherein, the target outline list is generated by the outline list generation method described in any of the above-mentioned items;

[0194] S203, Display the first page, which displays the target outline list.

[0195] The specific methods of user interaction with the target document are not limited; for example, user interaction with the target document may include clicking the list generation function button. Furthermore, the page format of the first page can be any existing page format, and is not limited here.

[0196] In this embodiment of the invention, after receiving a user operation on a target document, the system can respond to the user operation by generating a target outline list for the target document and displaying it on the first page. This allows for the generation of a corresponding target outline list according to the user's needs, thereby improving the user experience.

[0197] Compared to the embodiments of the above method, such as Figure 4 As shown, an embodiment of the present invention provides an outline list generation device, comprising:

[0198] The outline acquisition module 310 is used to acquire multiple outline titles in a target document, wherein the acquired multiple outline titles are ordered according to their position in the target document;

[0199] The hierarchy determination module 320 is used to determine the hierarchy to which the multiple outline headings belong based on the naming structure of the multiple outline headings and their positional order in the target document.

[0200] The outline fusion module 330 is used to merge multiple target outline titles belonging to a predetermined level according to the order of the level to obtain a target outline list.

[0201] As can be seen, this solution can generate outline lists of multiple target outline titles at a predetermined level when generating the target outline list, that is, it can generate outline lists of multiple target outline titles at the level required by the user. This solves the problem of existing technologies being unable to generate corresponding outline lists based on the user's outline title viewing needs, resulting in a poor user experience.

[0202] Optionally, the outline acquisition module 310 includes an outline determination submodule, which is used to extract multiple paragraphs from the target document sequentially according to their positional order in the target document; for each paragraph, identify the sentence at the beginning of the paragraph as the target sentence; and determine multiple outline titles from the identified multiple target sentences. Specifically, outline titles can be matched from the identified multiple target sentences according to a predetermined regular expression; wherein the predetermined regular expression is one or more, and each regular expression is used to match outline titles with a naming structure.

[0203] Optionally, the outline acquisition module 310 includes: an outline extraction submodule, the outline extraction submodule being used for:

[0204] Extract multiple outline headings from the target document and record the positions of the outline headings in the target document;

[0205] The outline headings are grouped according to their naming structure to obtain multiple outline heading groups;

[0206] According to the position of the outline titles in the target document, the outline titles in each outline title group are sorted to obtain multiple sorted outline title groups.

[0207] Optionally, the outline extraction submodule is specifically used to extract multiple outline titles from the target document based on multiple predetermined regular expressions, and record the position of the outline titles in the target document, wherein each regular expression is used to match an outline title with a naming structure.

[0208] Optionally, each predetermined regular expression includes three components: a start part, a numeric part, and an end part. Each component contains element values ​​that match the specified component, and the element values ​​of the numeric part are not empty.

[0209] Optionally, the hierarchy determination module 320 is specifically used to take the outline title group containing the first outline title in the target document as the outline title group corresponding to the highest level.

[0210] Optionally, the hierarchy determination module 320 is further used for

[0211] From the currently determined outline heading groups, find the lowest level outline heading group to obtain the outline heading group for the current level.

[0212] Determine the naming structure of the next level below the current level, wherein the naming structure of the next level is the naming structure corresponding to the outline title located after the first outline title in the target document and whose naming structure is different from that of the first outline title; wherein the first outline title is the outline title belonging to the outline title group of the current level.

[0213] The outline heading group corresponding to the naming structure of the next level is used as the outline heading group corresponding to the next level.

[0214] Optionally, the outline fusion module 330 is specifically used to determine, from the plurality of outline title groups, a plurality of outline title groups belonging to a predetermined level, to obtain a plurality of target outline title groups;

[0215] For each target outline title in each target outline title group, determine the base outline title corresponding to each target outline title; wherein, the base outline title corresponding to the target outline title is the outline title corresponding to the next higher level of the target outline title;

[0216] Based on the positional order of each target outline title in the target document, the target outline titles are merged into each baseline outline title to obtain the outline list of the target document.

[0217] Optionally, the hierarchy determination module 320 is specifically used to take the first outline title in the target document and the outline titles with the same naming structure as the first outline title as the outline titles corresponding to the highest level.

[0218] Optionally, the level determination module 320 is further configured to find the lowest level from the currently determined levels to obtain the current level;

[0219] Determine the naming structure of the next level below the current level, wherein the naming structure of the next level is the naming structure corresponding to the outline title located one position after the first outline title in the target document and whose naming structure is different from that of the first outline title; wherein the first outline title is the outline title belonging to the current level.

[0220] If the first outline title is not the last outline title of the current level, the outline title located between the first outline title and the second outline title in the target document and having the naming structure of the next level is determined as the outline title corresponding to the next level. The second outline title is an outline title that belongs to the same level as the first outline title and is adjacent to the first outline title.

[0221] If the first outline title is the last outline title of the current level, then the outline title in the target document that is located after the first outline title and has the naming structure of the next level is determined as the outline title corresponding to the next level.

[0222] Optionally, the device further includes: an identifier attachment module, used to attach a pattern identifier to each outline title; wherein the pattern identifier is a unique identifier corresponding to a regular expression that matches the outline title, and outline titles with the same pattern identifier are outline titles with the same naming structure.

[0223] Optionally, the outline fusion module 330 is specifically used to determine multiple outline titles belonging to a predetermined level from the multiple outline titles, and obtain multiple target outline titles;

[0224] For each target outline title, determine the corresponding baseline outline title; wherein, the baseline outline title is the target outline title at the next higher level of the target outline title.

[0225] Based on the position of the target outline title in the target document, the target outline title is merged between each baseline outline title or after the last baseline outline title to obtain the outline list of the target document.

[0226] Optionally, the apparatus further includes a predetermined level module, used to determine a predetermined level before the outline acquisition module 310, wherein the predetermined level is the level to be merged into the target outline list.

[0227] This invention provides an apparatus for generating an outline list, comprising:

[0228] The operation receiving module is used to receive user operations on the target document;

[0229] An operation response module is configured to respond to the user operation to generate a target outline list of the target document, wherein the target outline list is generated according to the outline list generation method described above.

[0230] The page display module is used to display the first page, which displays the target outline list.

[0231] This invention also provides an electronic device, such as... Figure 5 As shown, it includes a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0232] Memory 503 is used to store computer programs;

[0233] The processor 501 is used to implement any document outline extraction method when executing a program stored in the memory 503.

[0234] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0235] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0236] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0237] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0238] In another embodiment of the present invention, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described outline list generation methods.

[0239] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the outline list generation methods described above.

[0240] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0241] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0242] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, embodiments such as apparatus, electronic devices, and storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0243] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A method for generating an outline list, characterized in that, include: Retrieve multiple outline headings from the target document; Based on the naming structure of the multiple outline titles and their positional order in the target document, the hierarchy to which the multiple outline titles belong is determined, including: taking the outline title that appears first in the target document, and the outline titles with the same naming structure as the first outline title, as the outline titles corresponding to the highest level; finding the lowest level from the currently determined hierarchy to obtain the current level; determining the naming structure of the next level of the current level, wherein the naming structure of the next level is the naming structure corresponding to the outline title that is located one position after the first outline title in the target document and has a different naming structure from the first outline title, wherein the first outline title belongs to the current level. The outline titles at different levels; if the first outline title is not the last outline title of the current level, the outline title in the target document that is located between the first outline title and the second outline title and has the naming structure of the next level is determined as the outline title corresponding to the next level, wherein the second outline title is an outline title that belongs to the same level as the first outline title and is adjacent to the first outline title; if the first outline title is the last outline title of the current level, the outline title in the target document that is located after the first outline title and has the naming structure of the next level is determined as the outline title corresponding to the next level. To obtain a target outline list, multiple target outline titles belonging to a predetermined level are merged according to the order of the levels. This includes: identifying multiple outline titles belonging to a predetermined level from the multiple outline titles to obtain multiple target outline titles, wherein the predetermined level is the level to be merged into the target outline list; for each target outline title, determining the corresponding base outline title, wherein the base outline title is the target outline title corresponding to the previous level of the target outline title; and merging the target outline titles according to their position order in the target document to obtain the outline list of the target document.

2. The method according to claim 1, characterized in that, The process of obtaining multiple outline headings from the target document includes: Extract multiple paragraphs from the target document sequentially according to their positional order within the target document; For each paragraph, identify the sentence that appears at the beginning of the paragraph as the target sentence; From the identified target sentences, determine multiple outline headings.

3. The method according to claim 2, characterized in that, The process of determining multiple outline headings from the identified target sentences includes: Based on a predetermined regular expression, outline headings are matched from a plurality of identified target sentences; wherein the predetermined regular expression is one or more, and each regular expression is used to match outline headings with a naming structure.

4. The method according to claim 1, characterized in that, The process of obtaining multiple outline headings from the target document includes: Extract multiple outline headings from the target document and record the positions of the outline headings in the target document; The outline headings are grouped according to their naming structure to obtain multiple outline heading groups; According to the position of the outline titles in the target document, the outline titles in each outline title group are sorted to obtain multiple sorted outline title groups.

5. The method according to claim 4, characterized in that, The step of extracting multiple outline headings from the target document and recording the positions of the outline headings in the target document includes: Based on multiple predefined regular expressions, multiple outline headings are extracted from the target document, and the positions of the outline headings in the target document are recorded. Each regular expression is used to match outline headings with a naming structure.

6. The method according to claim 3 or 5, characterized in that, Each predefined regular expression includes three components: a start part, a numeric part, and an end part. Each component contains element values ​​that match the specified component, and the element values ​​of the numeric part are not empty.

7. The method according to claim 4, characterized in that, Based on the naming structure of the multiple outline headings and their positional order in the target document, the hierarchy to which the multiple outline headings belong is determined, including: The outline heading group containing the first outline heading in the target document is taken as the outline heading group corresponding to the highest level.

8. The method according to claim 7, characterized in that, Determining the hierarchy of the multiple outline headings based on their naming structure and positional order in the target document further includes: From the currently determined outline heading groups, find the lowest level outline heading group to obtain the outline heading group for the current level. Determine the naming structure of the next level below the current level, wherein the naming structure of the next level is the naming structure corresponding to the outline title located after the first outline title in the target document and whose naming structure is different from that of the first outline title; wherein the first outline title is the outline title belonging to the outline title group of the current level. The outline heading group corresponding to the naming structure of the next level is used as the outline heading group corresponding to the next level.

9. The method according to claim 7, characterized in that, Multiple target outline titles belonging to a predetermined level are merged according to the order of the levels to obtain a target outline list, including: From the multiple outline heading groups, determine multiple outline heading groups belonging to a predetermined level to obtain multiple target outline heading groups; For each target outline title in each target outline title group, determine the base outline title corresponding to each target outline title; wherein, the base outline title corresponding to the target outline title is the outline title corresponding to the next higher level of the target outline title; Based on the positional order of each target outline title in the target document, the target outline titles are merged into each baseline outline title to obtain the outline list of the target document.

10. The method according to claim 1, characterized in that, The method further includes: attaching a pattern identifier to each outline title; wherein the pattern identifier is a unique identifier corresponding to a regular expression that matches the outline title, and outline titles with the same pattern identifier are outline titles with the same naming structure.

11. The method according to claim 1, characterized in that, Based on the positional order of the target outline titles in the target document, the target outline titles are merged to obtain an outline list of the target document, including: Based on the positional order of the target outline titles in the target document, the target outline titles are merged between each baseline outline title or after the last baseline outline title to obtain the outline list of the target document.

12. The method according to claim 1, characterized in that, Before retrieving multiple outline headings from the target document, the process also includes: Determine the predetermined level.

13. A method for generating an outline list, characterized in that, Applied to electronic devices, including: Receive user actions for the target document; In response to the user operation, a target outline list of the target document is generated, wherein the target outline list is generated by the outline list generation method according to any one of claims 1-12; The first page is displayed, which shows the list of the target outlines.

14. An apparatus for generating an outline list, characterized in that, include: The outline retrieval module is used to retrieve multiple outline headings from a target document; The hierarchy determination module is used to determine the hierarchy to which the multiple outline titles belong based on their naming structure and positional order in the target document. This includes: identifying the outline title that appears first in the target document, and the outline titles with the same naming structure as the first outline title, as the outline titles corresponding to the highest level; finding the lowest level from the currently determined hierarchy to obtain the current level; and determining the naming structure of the next level, wherein the naming structure of the next level is the naming structure corresponding to the outline title located one position after the first outline title in the target document and with a different naming structure from the first outline title, where the first outline title is the one to which the outline title belongs. The outline title at the current level; if the first outline title is not the last outline title at the current level, the outline title in the target document that is located between the first outline title and the second outline title and has the naming structure of the next level is determined as the outline title corresponding to the next level, wherein the second outline title is an outline title that belongs to the same level as the first outline title and is adjacent to the first outline title; if the first outline title is the last outline title at the current level, the outline title in the target document that is located after the first outline title and has the naming structure of the next level is determined as the outline title corresponding to the next level. The outline fusion module is used to merge multiple target outline titles belonging to a predetermined level according to the order of the levels to obtain a target outline list. This includes: determining multiple outline titles belonging to a predetermined level from the multiple outline titles to obtain multiple target outline titles, wherein the predetermined level is the level to be merged into the target outline list; for each target outline title, determining the corresponding baseline outline title, wherein the baseline outline title is the target outline title corresponding to the level above the target outline title; and merging the target outline titles according to their position order in the target document to obtain the outline list of the target document.

15. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method according to any one of claims 1-12 or 13.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-12 or 13.

Citation Information

Patent Citations

  • Profile display method, device and equipment

    CN111046629A

  • Document hierarchy division method, document hierarchy division device and readable storage medium

    CN111079402A