Courseware structuring method and device, equipment and storage medium

By obtaining the text box feature information of the courseware and automatically classifying it using the classification detection model, the structure of the courseware is realized, solving the problem of inefficient structure of courseware in the existing technology, and improving the efficiency of automation structure.

CN118939709APending Publication Date: 2024-11-12GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310520206.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-09
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the existing technology, the structured courseware is inefficient, and it is difficult to cope with the structured needs of large-scale courseware, and it mainly relies on manual operations and cannot achieve automation.

Method used

By obtaining the text box feature information in the courseware, calling the preset classification detection model to classify the text text, identifying the title and text text, and structuring the courseware according to the title level to realize the automated structured process.

Benefits of technology

It improves the efficiency of the structured courseware, saves time, can automatically complete the structured courseware process, and solves the problem of inefficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939709A_ABST
    Figure CN118939709A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a courseware structuring method and device, equipment and a storage medium, and the method comprises the steps: after obtaining a target courseware, firstly analyzing a textbox in the target courseware and the feature information of the textbox, and distinguishing a first title textbox and a text textbox according to the feature information; and for the main body textbox, further identifying the main body text and the second title text in the main body textbox through a pre-trained classification detection model. And then determining a title level of the first title text and a title level of the second title text in the first title textbox, and structuring the target courseware according to the first title text, the second title text, the title levels and the body text. According to the embodiment of the invention, after the courseware is obtained, the structuring process of the courseware can be automatically realized, the efficiency of structuring the courseware is improved, and the technical problem that the efficiency of structuring the courseware is low in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of automated office, and in particular to a courseware structuring method, device, equipment and storage medium. Background Art

[0002] Courseware structuring refers to the process of analyzing the content of courseware to identify information such as the title, title level, title position, body text, and body text position in the courseware. Structuring courseware can make the information in the courseware more organized, easier to understand and remember. After structuring, courseware can be easily converted into various forms of learning resources, such as slides, notes, etc., to facilitate knowledge sharing and transfer on different platforms and occasions. However, the current courseware structuring process mainly relies on manual work, which is time-consuming, labor-intensive, inefficient, and difficult to meet the structuring needs of large-scale courseware.

[0003] In summary, how to improve the efficiency of structuring courseware in the existing technology has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The embodiments of the present invention provide a courseware structuring method, device, equipment and storage medium. The embodiments of the present invention can automatically structure the courseware, improve the efficiency of structuring the courseware, and solve the technical problem of low efficiency of courseware structuring in the prior art.

[0005] In a first aspect, an embodiment of the present invention provides a courseware structuring method, comprising:

[0006] Obtain the target courseware, determine the text box of each page in the target courseware and the characteristic information of the text box;

[0007] According to the characteristic information, a first title text box for displaying a title and a main text box for displaying a main text in each page are determined;

[0008] Calling a preset classification detection model to classify the text in each body text box to identify the body text and the second title text in each body text box;

[0009] Determine a title level corresponding to the second title text and a title level corresponding to the first title text in the first title text box;

[0010] The target courseware is structured according to the first title text, the second title text, the title hierarchy and the main text.

[0011] In a second aspect, an embodiment of the present invention provides a courseware structuring device, including:

[0012] The courseware acquisition module is used to acquire the target courseware, determine the text box of each page in the target courseware and the characteristic information of the text box;

[0013] A text box determination module, used to determine a first title text box for displaying a title and a main text box for displaying a main text in each page according to the characteristic information;

[0014] A text classification module, used to call a preset classification detection model to classify the text in each body text box, so as to identify the body text and the second title text in each body text box;

[0015] A level determination module, used to determine the title level corresponding to the second title text and the title level corresponding to the first title text in the first title text box;

[0016] The structuring module is used to structure the target courseware according to the first title text, the second title text, the title level and the main text.

[0017] In a third aspect, an embodiment of the present invention provides a courseware structuring device, the courseware structuring device comprising a processor and a memory;

[0018] The memory is used to store the computer program and transmit the computer program to the processor;

[0019] The processor is used to execute a courseware structuring method as described in the first aspect according to instructions in a computer program.

[0020] In a fourth aspect, an embodiment of the present invention provides a storage medium storing computer executable instructions, which, when executed by a computer processor, are used to execute a courseware structuring method as in the first aspect.

[0021] As mentioned above, after acquiring the target courseware, the embodiment of the present invention first parses out the text box in the target courseware and the feature information of the text box, and distinguishes the first title text box and the main text box according to the feature information. For the main text box, the main text and the second title text in the main text box are further identified by a pre-trained classification detection model. After that, the title level of the first title text and the title level of the second title text in the first title text box are determined, and the target courseware is structured according to the first title text, the second title text, the title level and the main text. After acquiring the courseware, the embodiment of the present invention can automatically implement the structuring process of the courseware, save the time for structuring the courseware, improve the efficiency of structuring the courseware, and solve the technical problem of low efficiency of courseware structuring in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 A flow chart of a courseware structuring method provided in an embodiment of the present invention.

[0023] Figure 2 A schematic diagram of a text box provided by an embodiment of the present invention.

[0024] Figure 3 A schematic diagram of a title hierarchy provided in an embodiment of the present invention.

[0025] Figure 4 A schematic diagram of structuring target courseware provided in an embodiment of the present invention.

[0026] Figure 5 A flowchart of another courseware structuring method provided in an embodiment of the present invention.

[0027] Figure 6 A schematic diagram of an annotation text box provided in an embodiment of the present invention.

[0028] Figure 7 A schematic diagram of distinguishing a first title text box and a body text box from a text box provided in an embodiment of the present invention.

[0029] Figure 8 A flowchart of another courseware structuring method provided in an embodiment of the present invention.

[0030] Fig. 9 A schematic diagram of the structure of a FastText model provided in an embodiment of the present invention.

[0031] Fig.10 A schematic diagram of the structure of a courseware structuring device provided in an embodiment of the present invention.

[0032] Fig.11 A schematic diagram of the structure of a courseware structuring device provided in an embodiment of the present invention.

[0033] Reference numerals:

[0034] A first text box 11, a second text box 12, and a comment text box 13. DETAILED DESCRIPTION

[0035] The following description and accompanying drawings fully illustrate the specific embodiments of the present application so that those skilled in the art can practice them. The examples represent possible variations only. Unless explicitly required, separate components and functions are optional, and the order of operation can vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. The scope of the embodiments of the present application includes the entire scope of the claims, and all available equivalents of the claims. In this article, each embodiment may be represented individually or generally by the term "invention", which is only for convenience, and if more than one invention is disclosed in fact, it is not intended to automatically limit the scope of the application to any single invention or inventive concept. In this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, without requiring or implying any actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed. The various embodiments are described in a progressive manner herein, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. As for the structures, products, etc. disclosed in the embodiments, since they correspond to the parts disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0036] At present, when structuring courseware in the prior art, the following steps are generally required:

[0037] Courseware preprocessing: divide the courseware into segments and sentences.

[0038] Keyword extraction: Extract keywords from courseware, generally using keyword extraction tools.

[0039] Sentence classification: For paragraphed or sentence-divided texts, classify them into different topics or types based on keywords and match them with corresponding titles or contents.

[0040] Data storage: Mark titles or contents by setting different styles, structure courseware, and save the courseware in the form of slides for subsequent query and analysis.

[0041] However, the existing methods for structuring courseware are mainly based on manual work. The structuring process is time-consuming and labor-intensive, and it is difficult to meet the structuring needs of large-scale courseware. In addition, the structuring process is relatively simple and can only recognize pre-set hierarchical texts. It cannot be automated, and the efficiency of courseware structuring is low.

[0042] In order to solve the technical problem of low efficiency in structuring courseware in the prior art, an embodiment of the present invention provides a courseware structuring method. Figure 1 As shown, Figure 1 A flow chart of a courseware structuring method provided in an embodiment of the present invention. The courseware structuring method provided in an embodiment of the present invention can be executed by a courseware structuring device, which can be implemented by software and / or hardware. The courseware structuring device can be composed of two or more physical entities, or can be composed of one physical entity. For example, the courseware structuring device can be a computer, a tablet, a mobile phone, and other devices. The method includes the following steps:

[0043] Step 101: Obtain target courseware, determine the text box of each page in the target courseware and feature information of the text box.

[0044] In this embodiment, the courseware structuring device first needs to obtain the target courseware, wherein the target courseware is the courseware pre-specified by the user or currently selected by the user, and the method of obtaining the target courseware can be set according to actual needs. For example, the courseware structuring device can obtain the target courseware from a pre-set storage path, or the courseware structuring device obtains the target courseware from the cloud through a server, or the courseware structuring device obtains the target courseware by communicating with other devices.

[0045] After obtaining the target courseware, the courseware structuring device needs to analyze the target courseware to determine the text boxes in each page of the target courseware and the characteristic information of each text box. The text box refers to a movable and resizable text container. The user can directly edit the text in the text box. By using the text box, the user can place several text blocks on a page, or arrange the text in a different direction from other text in the document. For example, Figure 2 As shown, Figure 2 It is a schematic diagram of a page in the courseware. There are two text boxes in the page, namely a first text box 11 and a second text box 12.

[0046] The characteristic information of a text box refers to information including characteristics for identifying a text box, for example, the characteristic information may be the position of a text box or the content in the text box. In one embodiment, when parsing the target courseware, the courseware structuring device may convert the target courseware into data in a preset format, and then parse the data in the preset format to determine the elements in each page. The element type of the page may be a text box, a picture, an animation, etc. Then, the text box in each page is determined according to the element type, and the characteristic information corresponding to the text box is extracted.

[0047] Step 102: Determine, based on the characteristic information, a first title text box for displaying the title and a main text box for displaying the main text in each page.

[0048] After extracting the characteristic information of the text box, the courseware structuring device needs to further determine the first title text box for displaying the title and the main text box for displaying the text in each page based on the characteristic information of the text box. The title refers to a short sentence used to indicate the main idea of ​​the article and the main idea of ​​the chapter; the main text refers to the content other than the preface, table of contents, postscript and notes. In one embodiment, when determining the first title text box and the main text box based on the characteristic information, the text boxes that are not used to display the text (such as text boxes for displaying annotation content, etc.) can be first eliminated based on the position information of the text box. Afterwards, a target main text box is determined in each page, and the main text box and the title text box are determined in other text boxes by calculating the difference between the text style of the target main text box and the text style of other text boxes in each page.

[0049] Step 103: Call a preset classification detection model to classify the text in each main text box to identify the main text and the second title text in each main text box.

[0050] After determining the main text box in each page, in the actual text editing process, the user may write the title and the main text content in the same main text box at the same time. Therefore, in this embodiment, it is necessary to further distinguish the title and the main text in the main text box. Specifically, in this embodiment, a classification detection model for identifying the main text and the title text can be trained in advance based on a neural network, and the classification detection model is subsequently called to classify the text in each main text box, so that the main text and the second title text in the main text box can be identified. The second title text refers to the text including the title content.

[0051] Step 104: Determine the title level corresponding to the second title text and the title level corresponding to the first title text in the first title text box.

[0052] After determining the second title text in the body text box of each page, the courseware structuring device also needs to further determine the title level of the first title text and the title level of the second title text. The title level is used to characterize the level of the title in the overall content of the target courseware. Exemplarily, the title level may include a first-level title, a second-level title, and a third-level title, etc., wherein the first-level title is the general title, the second-level title and the third-level title are sub-titles, the second-level title is a subordinate title of the first-level title, and the third-level title is a subordinate title of the second-level title. In one embodiment, the first title text in the first title text box that appears first in the target courseware can be determined as a first-level title, the first title text in other first text boxes can be determined as a second-level title, all second title texts can be determined as third-level titles, and the third-level title located between two adjacent second-level titles is a subordinate title of the second-level title that appears in the order of appearance in front of the two second-level titles.

[0053] For example, Figure 3 As shown, Figure 3 This is a schematic diagram of a page in the courseware. Figure 3 In the above text, sub-title 1 and sub-title 2 are subordinate titles of the first-level title, the text content of body text 1 is subordinate content of sub-title 1, and the content of body text 2 is subordinate content of sub-title 2. In another embodiment, the title level of the first title text and the title level of the second title text can also be determined according to the size and form of the numbers at the beginning of the sentences in the first title text and the second title text.

[0054] Step 105: Structuring the target courseware according to the first title text, the second title text, the title level and the body text.

[0055] After determining the first title text, the second title text, the title level and the body text in the target courseware, the first title text, the second title text and the body text can be further marked in the target courseware, and the first title text and the second title text are marked with the corresponding title level to complete the structuring of the target courseware. The specific process is as follows: Figure 4 shown.

[0056] As mentioned above, after acquiring the target courseware, the embodiment of the present invention first parses out the text box in the target courseware and the feature information of the text box, and distinguishes the first title text box and the main text box according to the feature information. For the main text box, the main text and the second title text in the main text box are further identified by a pre-trained classification detection model. After that, the title level of the first title text and the title level of the second title text in the first title text box are determined, and the target courseware is structured according to the first title text, the second title text, the title level and the main text. After acquiring the courseware, the embodiment of the present invention can automatically implement the structuring process of the courseware, save the time for structuring the courseware, improve the efficiency of structuring the courseware, and solve the technical problem of low efficiency of courseware structuring in the prior art.

[0057] like Figure 5 As shown, Figure 5 A flow chart of another courseware structuring method provided by an embodiment of the present invention is shown as follows: Figure 5 The courseware structuring method is a specific implementation of the above courseware structuring method, which includes:

[0058] Step 201: Obtain the target courseware, determine the text box of each page in the target courseware and the characteristic information of the text box, the characteristic information including the position information of the text box and the content information of the text box.

[0059] In this embodiment, the characteristic information of the text box includes the position information of the text box and the content information of the text box, wherein the position information is used to indicate the position of the text box in the page, and the position information can be expressed by establishing a two-dimensional coordinate system on each page of the target courseware and according to the two-dimensional coordinates of the four corner points of the text box in the two-dimensional coordinate system. The content information is used to indicate the text content in the text box.

[0060] Step 202: Determine the valid text boxes in each page according to the position information of each text box.

[0061] After obtaining the characteristic information of the text box, it is first necessary to determine the valid text box in each page based on the position information in the characteristic information. The valid text box refers to the text box used to display the text and title of the target courseware. For example, when a user annotates the target courseware, since the content of the annotation belongs neither to the text nor to the title, the text box used to display the annotation content is not a valid text box. In one embodiment, the user can determine whether the text box in the page is a valid text box based on whether the position of the text box is within the area of ​​the page used to display the content.

[0062] Based on the above embodiment, in step 202, valid text boxes in each page are determined according to the position information of each text box, including:

[0063] Step 2021: Determine the content display area in each page.

[0064] In one embodiment, it is first necessary to determine the content display area of ​​each page, wherein the content display area refers to the area of ​​each page used to display the text and title. In one embodiment, the courseware structuring device can obtain the size of each page and determine the content display area of ​​the page in the two-dimensional coordinate system of each page according to the size.

[0065] Step 2022: According to the position information of each text box in each page, determine that the text box located in the content display area is a valid text box.

[0066] After determining the content display area in each page, the courseware structuring device can determine whether each text box is completely located within the content display area of ​​the corresponding page based on the position information of each text box in each page. If so, the text box is a valid text box; otherwise, it is not a valid text box. For example, Figure 6 As shown, Figure 6 13 is a comment text box, and the comment text box cannot be located in the content display area of ​​the page. In one embodiment, the courseware structuring device can also align the horizontal coordinates of the text boxes in each page. Since the comment text box is located outside the content display area, the horizontal coordinates of the content text box cannot be aligned with the horizontal coordinates of the text boxes in the content display area. Therefore, according to the aligned horizontal coordinates, valid text boxes can also be screened out.

[0067] The above is the specific process of determining the valid text boxes in each page.

[0068] Step 203: According to the content information of each valid text box, a target text box for displaying the text is determined in each page.

[0069] After determining the valid text boxes in each page, in order to filter out the first title text box for displaying the title and the text text box for displaying the text, the courseware structuring device also needs to first determine a target text text box for displaying the text in the valid text boxes of each page. In this embodiment, since the text content to be displayed in the text text box is generally more than the content to be displayed in the title, the courseware structuring device can determine a target text text box in each page according to the number of characters contained in each valid text box.

[0070] Based on the above embodiment, in step 203, a target text box for displaying the text is determined in each page according to the content information of each valid text box, including:

[0071] Step 2031: Determine the number of characters in each valid text box in each page according to the content information of each valid text box in each page.

[0072] In one embodiment, when determining the target text box, the courseware structuring device can determine the number of characters in each valid text box according to the content information of each valid text box in each page. Characters refer to glyph units or symbols, including letters, numbers, operation symbols, punctuation marks, and some functional symbols.

[0073] Step 2032: Determine the valid text box with the largest number of characters in each page as the target text text box for displaying the text.

[0074] After determining the number of characters in each valid text box in each page, the courseware structuring device can determine the valid text box with the largest number of characters in each page as the target text text box for displaying the text.

[0075] The above is the specific process of determining the target text box. In another embodiment, since the target text box has the largest number of characters, which means that the target text box occupies the largest range, in another optional solution, the courseware structuring device can also determine the valid text box with the largest range as the target text box based on the range occupied by each valid text box in each page.

[0076] Step 204: In each page, calculate the difference between the target text box and other valid text boxes.

[0077] After determining the target body text box in each page, the difference between other valid text boxes and the target body text box needs to be considered in order to correctly distinguish the title text box from the body text box. In one embodiment, since the style of the body text is generally the same in the same page, while the style of the title text is different from the style of the body text, the difference between the target body text box and other valid text boxes can be calculated based on the style of the text, wherein the difference is used to measure the degree of difference between the target body text box and other valid text boxes.

[0078] Based on the above embodiment, the feature information also includes text style information.

[0079] In one embodiment, the characteristic information in the text box also includes text style information, wherein the text style information refers to information about the style of the content text in the text box, such as the font, font size, and background color of the content text.

[0080] In step 204, in each page, the difference between the target text box and other valid text boxes is calculated, including:

[0081] Step 2041: Determine the first text style information of the target body text box and the second text style information of other valid text boxes.

[0082] When calculating the difference between the target body text box and other valid text boxes, the courseware structuring device can first determine the first text style information of the target body text box and the second text style information of other valid text boxes in each page based on the content information of the text boxes.

[0083] Step 2042: Calculate the difference between the first text style information and each second text style information to obtain the difference between the target body text box and other valid text boxes.

[0084] After determining the first text style information and the second text style information, for each page, the courseware structuring device calculates the difference between the first text style information of the target body text box and the second text style information of other valid text boxes. In one embodiment, the courseware structuring device can calculate the number of style parameters that differ in the first text style information and the second text style information, and calculate the difference based on the number of style parameters, thereby obtaining the difference between the target body text box and other valid text boxes, wherein the style parameters are used to set the style of the text.

[0085] Based on the above embodiment, the first text style information and the second text style information each include seven style parameters, including: indentation parameter, foreground color parameter, background color parameter, Chinese font parameter, English font parameter, font size parameter and font shape parameter.

[0086] In one embodiment, the first text style information and the second text style information each include seven style parameters, which are: indentation parameter, foreground color parameter, background color parameter, Chinese font parameter, English font parameter, font size parameter, and font morphology parameter. The indentation parameter is used to set the distance between the text in the text box and the page border; the foreground color parameter is used to set the fill color and pattern color in the text box; the background color parameter is used to set the background color in the text box; the Chinese font parameter is used to set the font of the Chinese in the text box; the English font parameter is used to set the font of the English in the text box; the font size parameter sets the size of the characters in the text box; and the font morphology parameter is used to set the font morphology of the font in the text box.

[0087] Calculating the difference between the first text style information and each second text style information in step 2042 includes:

[0088] Step 20421: Calculate the number of style parameters that are different between the first text style information and each second text style information.

[0089] In this embodiment, it is first necessary to calculate the number of style parameters that differ between the first text style information of the target text box and the second text style information of other valid text boxes in each page. Exemplarily, it is assumed that the first text style information of the target text box is: indentation parameter: indentation, foreground color parameter: black, background color parameter: white, Chinese font parameter: Kaiti, English font parameter: Times New Roman, font size parameter: 30, font morphology parameter: none. The second text style information of a valid text box among the other valid text boxes is: indentation parameter: no indentation, foreground color parameter: red, background color parameter: white, Chinese font parameter: Kaiti, English font parameter: Times New Roman, font size parameter: 40, font morphology parameter: black. At this time, the style parameters that differ between the target text box and the valid text box include indentation parameters, foreground color parameters, font size parameters and font morphology parameters.

[0090] Step 20422: normalize the quantity to obtain the difference between the first text style information and each second text style information.

[0091] After determining the number of style parameters that are different between the target body text box and other valid text boxes, the number is normalized to obtain the difference between the first text style information and each second text style information. For example, when the number of different style parameters is 4, since there are 7 style parameters in total, the normalized result is 4 / 7=0.57, that is, the difference between the target body text box and the valid text box is 0.57.

[0092] The above is the specific process of calculating the difference between the target text box and other valid text boxes.

[0093] Step 205: According to the difference, determine a first title text box for displaying the title and a text text box for displaying the text in other valid text boxes corresponding to each page.

[0094] After determining the difference between the target main text box and other valid text boxes, the first title text box for displaying the title and the main text box for displaying the main text can be determined from the other valid text boxes corresponding to each page. Exemplarily, the user can pre-set a difference threshold, and then, for each page, the courseware structuring device can filter out valid text boxes whose difference from the target main text box is greater than the difference threshold from the other valid text boxes, and determine the filtered valid text boxes as the first title text box for displaying the title, and determine the remaining valid text boxes as the main text boxes for displaying the main text. The specific process is as follows: Figure 7 shown.

[0095] Step 206: Call a preset classification detection model to classify the text in each main text box to identify the main text and the second title text in each main text box.

[0096] Step 207: Determine the title level corresponding to the second title text and the title level corresponding to the first title text in the first title text box.

[0097] Step 208: Structuring the target courseware according to the first title text, the second title text, the title level and the body text.

[0098] As described above, when distinguishing the title text box and the text text box in the courseware, the embodiment of the present invention first screens out the valid text boxes in each page according to the position information in each text box, and determines the target text text box with the largest number of characters from the valid text boxes. Afterwards, according to the text style information of the target text text box and the text style information of other valid text boxes, the difference between the target text text box and other valid text boxes in each page is calculated, and the title text box and the text text box are distinguished from the other valid text boxes according to the difference. In the embodiment of the present invention, the valid text content in the page is distinguished based on the position of the text box, and a text similarity evaluation mechanism is defined based on the text style, and the first title text box for displaying the title and the text text box for displaying the text are distinguished from the text boxes on each page, which has high robustness. After obtaining the courseware, the embodiment of the present invention can automatically realize the structuring process of the courseware, save the time for structuring the courseware, improve the efficiency of structuring the courseware, and solve the technical problem of low efficiency of courseware structuring in the prior art.

[0099] like Figure 8 As shown, Figure 8 A flow chart of another courseware structuring method provided by an embodiment of the present invention is shown as follows: Figure 8 The courseware structuring method is a specific implementation of the above courseware structuring method, which includes:

[0100] Step 301: Get the target courseware.

[0101] Step 302: Convert the target courseware into target format data.

[0102] In this embodiment, after the target courseware is obtained, it is necessary to further convert the target courseware into target format data, wherein the target format data refers to data whose data format is a pre-specified format, wherein the specific type of the target format can be set according to actual needs, and is not specifically limited in this embodiment. Exemplarily, the target courseware obtained by the courseware structuring device is a file in XML (Extensible Markup Language) format. At this time, it is necessary to convert the XML file into JSON (JavaScript Object Notation) data format, and the JSON format is the target format data. Specifically, the XML2JSON function can be used to convert the XML file into JSON format data. The specific conversion process can refer to the prior art and will not be described in detail in this embodiment.

[0103] Step 303: parse the target format data to determine the text box of each page in the target courseware and the characteristic information of the text box.

[0104] After converting the target courseware into the target format data, the courseware structuring device can parse the target format data to determine the text boxes corresponding to each page in the target courseware and the characteristic information of the text boxes. For example, when the target format data is in JSON format, the courseware structuring device can index the text boxes according to the fields and extract the location and content of the text boxes to obtain the characteristic information of the text boxes.

[0105] Step 304: Determine, based on the characteristic information, a first title text box for displaying the title and a main text box for displaying the main text in each page.

[0106] Step 305: Call a preset classification detection model to classify the text in each main text box to identify the main text and the second title text in each main text box, and the classification detection model is a FastText model.

[0107] In this embodiment, the classification detection model is the FastText model. The FastText model is a fast text classification model that is lightweight and fast. Its training speed is several times or even dozens of times faster than other models. The input of the FastText model is a sequence of words (a paragraph of text or a sentence), and the output is the probability that the word sequence belongs to different categories. The categories can be pre-determined by methods such as manual annotation. Fig. 9 As shown in the figure, the FastText model includes an input layer, a hidden layer, and an output layer. The input layer inputs the embedding (word vector) representation of each word in the input text, and the article can be represented by the mean of the accumulated embeddings of all words. The input embedding representation is then input to the hidden layer and undergoes a nonlinear transformation to obtain the category of the output layer.

[0108] Specifically, in this embodiment, when training the FastText model, it is necessary to first obtain a training set. For example, some courseware pages containing body text and title text can be selected and annotated, and the body text is stored as a category in "0.txt", and the title text is stored as another category in "1.txt", thereby obtaining a training set. It can be understood that the category of the text in "0.txt" in the training set is 0, and the category of the text in "1.txt" is 1.

[0109] After that, the FastText model needs to be trained. The text in the training set needs to be converted into an embedding representation as the input of the FastText model. The output of the FastText model is the probability that the text belongs to each category. Then the cross entropy between the probability of the output category and the true category is calculated. During the training process, the cross entropy is minimized, that is, the difference between the predicted category and the true category is minimized.

[0110] There are two main training methods for the FastText model: hierarchical softmax training method and negative sampling training method. In this embodiment, the hierarchical softmax training method is selected, and the specific process is as follows:

[0111] (1) The text input to the FastText model is converted into an embedding representation using the bag-of-words model, and n-gram (n-gram is an algorithm based on a language model. The basic principle is to slide the text content in a window of size N in the order of subsections, and finally form a sequence of byte fragments with a window of N) with character level attached is used as the feature input.

[0112] (2) The embedding representation of the text is passed as input to the input layer. The input layer inputs the embedding representation into the hidden layer. In the hidden layer, the obtained embedding representation is added to other features and the mean is taken as the sentence vector feature.

[0113] (3) In the output layer, the FastText model uses a hierarchical softmax method to calculate the probability that the sentence vector feature belongs to each category. The hierarchical softmax method divides the two categories of 0 and 1 into two subsets. Each subset is a binary classification problem. Each time, only the probability of a subset needs to be calculated, rather than the probability of the entire category set. The output of the output layer is

[0114] In addition, the loss function during FastText model training is:

[0115]

[0116] where y is the true class (0 or 1), It is the predicted output value of the FastText model for the input text category (probability between 0 and 1). When y=1, the loss function only focuses on the part predicted as category 1; when y=0, the loss function only focuses on the part predicted as category 0. Therefore, this loss function can effectively push the FastText model to adjust the predicted output towards the correct label direction.

[0117] After the training is completed, the trained FastText model can be obtained. For the main text box, the text in the main text box is converted into an embedding representation and then input into the trained FastText model for classification prediction, thereby obtaining the probability that the text in the main text box belongs to the main text and the second title text.

[0118] Step 306: Determine the title level corresponding to the second title text and the title level corresponding to the first title text in the first title text box.

[0119] Step 307: Mark the first title text, the second title text, the title level, and the body text in the target format data.

[0120] After determining the first title text, the second title text, the body text, and the title hierarchy between the first title text and the second title text in the target courseware, the target courseware can be structured. In one embodiment, the first title text, the second title text, the body text, and the title hierarchy can be marked in the target format data in JSON format in units of "rows".

[0121] Step 308: Generate structured target courseware based on the marked target format data.

[0122] After the marking is completed, the structured target courseware can be generated according to the marked target format data. For example, the marked JSON format target format data is converted and output into an XML file to generate the structured target courseware.

[0123] As described above, the embodiment of the present invention creatively introduces the text classification capability based on the FastText model into the structuring process of the courseware text. Compared with the keyword extraction technology in the prior art, the embodiment of the present invention can intelligently analyze the content of the target courseware, greatly improving the accuracy of text classification, thereby improving the efficiency of structuring the courseware, and solving the technical problem of low efficiency of courseware structuring in the prior art.

[0124] like Fig.10 As shown, Fig.10 A schematic diagram of the structure of a courseware structuring device provided by an embodiment of the present invention, the courseware structuring device includes:

[0125] The courseware acquisition module 401 is used to acquire the target courseware, determine the text box of each page in the target courseware and the characteristic information of the text box;

[0126] A text box determination module 402 is used to determine, based on the characteristic information, a first title text box for displaying a title and a text text box for displaying a text in each page;

[0127] The text classification module 403 is used to call a preset classification detection model to classify the text in each body text box to identify the body text and the second title text in each body text box;

[0128] A level determination module 404 is used to determine a title level corresponding to the second title text and a title level corresponding to the first title text in the first title text box;

[0129] The structuring module 405 is used to structure the target courseware according to the first title text, the second title text, the title level and the body text.

[0130] Based on the above embodiment, the courseware acquisition module 401 includes:

[0131] The format conversion submodule is used to convert the target courseware into target format data;

[0132] The courseware parsing submodule is used to parse the target format data and determine the text box and feature information of each page in the target courseware.

[0133] Based on the above embodiment, the structured module 405 includes:

[0134] A marking submodule, used for marking the first title text, the second title text, the title level and the body text in the target format data;

[0135] The structuring submodule is used to generate structured target courseware according to the marked target format data.

[0136] Based on the above embodiment, the characteristic information includes the position information of the text box and the content information of the text box; the text box determination module 402 includes:

[0137] The valid text box determination submodule is used to determine the valid text boxes in each page according to the position information of each text box;

[0138] The target text box determination submodule is used to determine a target text box for displaying the text in each page according to the content information of each valid text box;

[0139] The difference calculation submodule is used to calculate the difference between the target text box and other valid text boxes in each page;

[0140] The text box distinguishing submodule is used to determine, according to the difference, a first title text box for displaying the title and a main text box for displaying the main text from other valid text boxes corresponding to each page.

[0141] Based on the above embodiment, the valid text box determination submodule includes:

[0142] An area determination unit, used to determine a content display area in each page;

[0143] The valid text box determination unit is used to determine the text box located in the content display area as a valid text box according to the position information of each text box in each page.

[0144] Based on the above embodiment, the target text box determination submodule includes:

[0145] A character quantity determination unit, used to determine the character quantity of each valid text box in each page according to the content information of each valid text box in each page;

[0146] The target text box determination unit is used to determine the valid text box with the largest number of characters in each page as the target text text box for displaying the text.

[0147] On the basis of the above embodiment, the feature information also includes text style information; the difference calculation submodule includes:

[0148] A style determination unit, used to determine first text style information of a target body text box and second text style information of other valid text boxes;

[0149] The difference calculation unit is used to calculate the difference between the first text style information and each second text style information to obtain the difference between the target body text box and other valid text boxes.

[0150] Based on the above embodiment, the first text style information and the second text style information each include seven style parameters, and the seven style parameters include: an indentation parameter, a foreground color parameter, a background color parameter, a Chinese font parameter, an English font parameter, a font size parameter, and a font shape parameter;

[0151] The difference calculation unit includes:

[0152] a difference determination subunit, used to calculate the number of style parameters that are different between the first text style information and each second text style information;

[0153] The difference calculation subunit is used to normalize the quantity to obtain the difference between the first text style information and each second text style information.

[0154] Based on the above embodiment, the classification detection model is a FastText model.

[0155] The courseware structuring device provided in the embodiment of the present invention is included in the courseware structuring equipment and can be used to execute the courseware structuring method provided in the above embodiment, and has corresponding functions and beneficial effects.

[0156] It is worth noting that in the embodiment of the above-mentioned courseware structuring device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0157] This embodiment also provides a courseware structuring device, such as Fig.11 As shown, the courseware structuring device 50 includes a processor 500 and a memory 501;

[0158] The memory 501 is used to store the computer program 502 and transmit the computer program 502 to the processor 500;

[0159] The processor 500 is used to execute the steps in the above-mentioned courseware structuring method embodiment according to the instructions in the computer program 502.

[0160] Exemplarily, the computer program 502 may be divided into one or more modules / units, one or more modules / units are stored in the memory 501, and are executed by the processor 500 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 502 in the courseware structuring device 50.

[0161] The courseware structuring device 50 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The courseware structuring device 50 may include, but is not limited to, a processor 500 and a memory 501. Those skilled in the art will appreciate that Fig.11 It is only an example of the courseware structuring device 50 and does not constitute a limitation of the courseware structuring device 50. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the courseware structuring device 50 may also include input and output devices, network access devices, buses, etc.

[0162] The processor 500 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0163] The memory 501 may be an internal storage unit of the courseware structuring device 50, such as a hard disk or memory of the courseware structuring device 50. The memory 501 may also be an external storage device of the courseware structuring device 50, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the courseware structuring device 50. Further, the memory 501 may also include both an internal storage unit and an external storage device of the courseware structuring device 50. The memory 501 is used to store computer programs and other programs and data required by the courseware structuring device 50. The memory 501 may also be used to temporarily store data that has been output or is to be output.

[0164] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0165] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0166] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0167] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0168] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store computer programs.

[0169] The embodiment of the present invention further provides a storage medium containing computer executable instructions, and the computer executable instructions are used to perform a courseware structuring method when executed by a computer processor, and the method includes the following steps:

[0170] Obtain the target courseware, determine the text box of each page in the target courseware and the characteristic information of the text box;

[0171] According to the characteristic information, a first title text box for displaying a title and a main text box for displaying a main text in each page are determined;

[0172] Calling a preset classification detection model to classify the text in each body text box to identify the body text and the second title text in each body text box;

[0173] Determine a title level corresponding to the second title text and a title level corresponding to the first title text in the first title text box;

[0174] The target courseware is structured according to the first title text, the second title text, the title hierarchy and the main text.

[0175] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the embodiments of the present invention are not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention are described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.

Claims

1. A courseware structuring method, It is characterized in that include: Acquire a target courseware, determine a text box on each page of the target courseware and feature information of the text box; Determine, according to the characteristic information, a first title text box for displaying a title and a text text box for displaying a text in each of the pages; Calling a preset classification detection model to classify the text in each of the main text boxes to identify the main text and the second title text in each of the main text boxes; Determine a title level corresponding to the second title text and a title level corresponding to the first title text in the first title text box; The target courseware is structured according to the first title text, the second title text, the title hierarchy and the body text.

2. A courseware structuring method according to claim 1, It is characterized in that The step of determining the text box of each page in the target courseware and the characteristic information of the text box includes: Converting the target courseware into target format data; The target format data is parsed to determine the text box of each page in the target courseware and the characteristic information of the text box.

3. A courseware structuring method according to claim 2, It is characterized in that The step of structuring the target courseware according to the first title text, the second title text, the title level and the body text includes: Marking the first title text, the second title text, the title level, and the body text in the target format data; Generate structured target courseware based on the marked target format data.

4. A courseware structuring method according to claim 1, It is characterized in that The characteristic information includes the position information of the text box and the content information of the text box; Determining, based on the characteristic information, a first title text box for displaying a title and a text text box for displaying a text in each page includes: Determine the valid text boxes in each page according to the position information of each text box; According to the content information of each of the valid text boxes, determining a target text box for displaying the text in each of the pages; In each of the pages, calculating the difference between the target text box and other valid text boxes; According to the difference, a first title text box for displaying the title and a main text box for displaying the main text are determined in other valid text boxes corresponding to each of the pages.

5. A courseware structuring method according to claim 4, It is characterized in that Determining the valid text boxes in each page according to the position information of each text box includes: Determine a content display area in each of the pages; According to the position information of each text box in each page, the text box located in the content display area is determined to be a valid text box.

6. A courseware structuring method according to claim 4, It is characterized in that Determining a target text text box for displaying the text in each page according to the content information of each valid text box includes: Determining the number of characters in each valid text box in each page according to the content information of each valid text box in each page; The valid text box with the largest number of characters in each page is determined as a target text text box for displaying the text.

7. A courseware structuring method according to claim 4, It is characterized in that The feature information also includes text style information; The step of calculating the difference between the target text box and other valid text boxes in each of the pages includes: Determine the first text style information of the target text box and the second text style information of other valid text boxes; The difference between the first text style information and each of the second text style information is calculated to obtain the difference between the target body text box and the other valid text boxes.

8. A courseware structuring method according to claim 7, It is characterized in that The first text style information and the second text style information each include seven style parameters, and the seven style parameters include: an indentation parameter, a foreground color parameter, a background color parameter, a Chinese font parameter, an English font parameter, a font size parameter, and a font shape parameter; The calculating the difference between the first text style information and each of the second text style information includes: Calculating the number of style parameters that are different between the first text style information and each of the second text style information; The quantity is normalized to obtain a difference between the first text style information and each piece of the second text style information.

9. A courseware structuring method according to claim 1, It is characterized in that The classification detection model is a FastText model.

10. A courseware structuring device, It is characterized in that include: A courseware acquisition module is used to acquire a target courseware, determine a text box on each page of the target courseware and feature information of the text box; A text box determination module, used to determine, according to the characteristic information, a first title text box for displaying a title and a text text box for displaying a text in each of the pages; A text classification module, used for calling a preset classification detection model to classify the text in each of the main text boxes, so as to identify the main text and the second title text in each of the main text boxes; A level determination module, used to determine the title level corresponding to the second title text and the title level corresponding to the first title text in the first title text box; A structuring module is used to structure the target courseware according to the first title text, the second title text, the title hierarchy and the body text.

11. A courseware structuring device, It is characterized in that The courseware structuring device includes a processor and a memory; The memory is used to store a computer program and transmit the computer program to the processor; The processor is used to execute a courseware structuring method as described in any one of claims 1-9 according to instructions in the computer program.

12. A storage medium storing computer executable instructions, It is characterized in that When the computer executable instructions are executed by a computer processor, they are used to perform a courseware structuring method as described in any one of claims 1-9.