A courseware automatic processing method, device and equipment and a storage medium
Patent Information
- Application Number
- CN202310344274.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2043-03-31
AI Technical Summary
[0004]本发明实施例提供了一种课件自动化处理方法、装置、设备及存储介质,本发明实施例能够提高课件的美化效率,解决了现有技术中课件的美化效率低下的技术问题
[0021]上述,本发明实施例在获取到目标课件后,对目标课件进行解析以及将目标课件输入到预设的目标检测模型中,从而分别得到目标课件中所有元素的第一结构化信息以及第一文本元素的文本结构化信息,之后根据第一结构化信息以及文本结构化信息,确定与目标课件相对应的目标结构化信息,并根据目标结构化信息对目标课件进行处理,从而得到美化后的目标课件。本发明实施例在获取到目标课件后,可自动实现目标课件的美化,在此过程中不需要人为参与,提高了课件的美化效率,解决了现有技术中课件的美化效率低下的技术问题。
Smart Images

Figure CN118736611B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automated office work, and more particularly to a method, apparatus, device, and storage medium for automated processing of courseware. Background Technology
[0002] Currently, with the widespread adoption of computers and the development of multimedia technology, using multimedia in teaching and other activities has gradually become a trend, and courseware is a crucial form of document presentation within multimedia technology. Courseware can visually and vividly present the content to students through text, graphics, colors, and animations. However, creating aesthetically pleasing courseware requires experience and a good aesthetic sense; currently, courseware is mainly beautified manually, resulting in low efficiency.
[0003] In conclusion, improving the efficiency of courseware enhancement has become a pressing technical problem that needs to be solved. Summary of the Invention
[0004] This invention provides an automated courseware processing method, apparatus, device, and storage medium. This invention can improve the efficiency of courseware enhancement and solves the technical problem of low enhancement efficiency in the prior art.
[0005] In a first aspect, embodiments of the present invention provide a method for automated processing of courseware, including:
[0006] Obtain the target courseware and extract the images corresponding to each page of the target courseware;
[0007] The target courseware is parsed to determine the first structured information of all elements corresponding to each page in the target courseware, and each page includes at least one element;
[0008] The image is input into the preset target detection model to obtain the text structure information of the first text element corresponding to each page;
[0009] Based on the first structured information and the text structured information, determine the target structured information corresponding to the target courseware;
[0010] The target courseware is processed based on the target structured information.
[0011] Secondly, embodiments of the present invention provide an automated courseware processing device, comprising:
[0012] The courseware acquisition module is used to acquire target courseware and extract images corresponding to each page of the target courseware;
[0013] The courseware parsing module is used to parse the target courseware and determine the first structured information of all elements corresponding to each page in the target courseware. Each page includes at least one element.
[0014] The model analysis module is used to input images into a preset target detection model to obtain the text structure information of the first text element corresponding to each page;
[0015] The information acquisition module is used to determine the target structured information corresponding to the target courseware based on the first structured information and the text structured information;
[0016] The courseware automation processing module is used to process target courseware based on target structured information.
[0017] Thirdly, embodiments of the present invention provide an automated courseware processing device, which includes a processor and a memory;
[0018] The memory is used to store computer programs and transfer them to the processor;
[0019] The processor is used to execute a courseware automation processing method, such as the first aspect, according to instructions in a computer program.
[0020] Fourthly, embodiments of the present invention provide a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform a courseware automation processing method as described in the first aspect.
[0021] As described above, in this embodiment of the invention, after obtaining the target courseware, the target courseware is parsed and input into a preset target detection model to obtain the first structured information of all elements in the target courseware and the text structured information of the first text elements. Then, based on the first structured information and the text structured information, the target structured information corresponding to the target courseware is determined, and the target courseware is processed according to the target structured information to obtain the beautified target courseware. This embodiment of the invention can automatically beautify the target courseware after obtaining it, without requiring human intervention, thus improving the beautification efficiency and solving the technical problem of low beautification efficiency in existing technologies. Attached Figure Description
[0022] Figure 1 This is a flowchart illustrating an automated courseware processing method provided in an embodiment of the present invention.
[0023] Figure 2 This is a schematic diagram of the elements included in a page of courseware provided in an embodiment of the present invention.
[0024] Figure 3 This is a schematic diagram illustrating the principle of an automated courseware processing method provided in an embodiment of the present invention.
[0025] Figure 4 This is a schematic diagram of the content of a page in the target courseware provided in an embodiment of the present invention.
[0026] Figure 5 This is a schematic diagram of the hierarchy of the first text element on a page in the target courseware provided in the embodiment of the present invention.
[0027] Figure 6 This is a schematic diagram illustrating the result of beautifying a page according to an embodiment of the present invention.
[0028] Figure 7 This is a flowchart illustrating another method for automating courseware processing provided in an embodiment of the present invention.
[0029] Figure 8 This is a flowchart illustrating another method for automating courseware processing provided in an embodiment of the present invention.
[0030] Figure 9 This is a schematic diagram illustrating the calculation of overlap in an embodiment of the present invention.
[0031] Figure 10 This is a schematic diagram illustrating the setting of text association areas across pages, as provided in an embodiment of the present invention.
[0032] Figure 11 This is a schematic diagram of the structure of an automated courseware processing device provided in an embodiment of the present invention.
[0033] Figure 12 This is a schematic diagram of the structure of an automated courseware processing device provided in an embodiment of the present invention. Detailed Implementation
[0034] The following description and accompanying drawings fully illustrate specific embodiments of this application to enable those skilled in the art to practice them. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. The scope of embodiments of this application includes the entire scope of the claims and all available equivalents of the claims. In this document, each embodiment may be referred to individually or collectively by the term "invention," which is merely for convenience and is not intended to automatically limit the scope of the application to any single invention or inventive concept if more than one invention is disclosed. Relational terms such as "first" and "second" are used herein only to distinguish one entity or operation from another, without requiring or implying any 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, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed. The various embodiments in this document are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the structures, products, etc., disclosed in the embodiments, since they correspond to the disclosed parts, the descriptions are relatively simple; relevant details can be found in the method section.
[0035] Currently, users typically enhance courseware by setting templates. Specifically, users need to select a template for each page, and the software then enhances each page based on the chosen template. This process requires manual template selection, resulting in low efficiency. Furthermore, template selection relies on user experience and aesthetic sense, sometimes leading to unsatisfactory enhancements.
[0036] In summary, to address the technical problem of low efficiency in beautifying courseware in existing technologies, this invention discloses an automated courseware processing method. For example... Figure 1 As shown, Figure 1 This is a flowchart illustrating an automated courseware processing method provided in an embodiment of the present invention. The automated courseware processing method provided in this embodiment can be executed by an automated courseware processing device, which can be implemented through software and / or hardware. The automated courseware processing device can consist of two or more physical entities, or it can consist of a single physical entity. For example, the automated courseware processing device can be a computer, mobile phone, or tablet. The method includes the following steps:
[0037] Step 101: Obtain the target courseware and extract the images corresponding to each page of the target courseware.
[0038] In this embodiment, the automated courseware processing device first needs to acquire the target courseware, which refers to the courseware specified by the user. The method of acquiring the target courseware can be set according to actual needs and is not specifically limited in this embodiment. For example, the automated courseware processing device can acquire the target courseware from a local storage path pre-specified by the user, or the automated courseware processing device can acquire the target courseware from the cloud through a server.
[0039] After acquiring the target courseware, the automated courseware processing device needs to further extract images corresponding to each page of the target courseware. Specifically, the automated courseware processing device can parse the target courseware, determine the image displayed on the screen for each page of the target courseware, and generate an image corresponding to that image, thus obtaining the image corresponding to each page. In another embodiment, the automated courseware processing device can also directly open the target courseware and sequentially take screenshots of the content of each page of the target courseware displayed on the screen, thereby obtaining the image corresponding to each page of the target courseware.
[0040] Step 102: Analyze the target courseware to determine the first structured information of all elements corresponding to each page in the target courseware. Each page includes at least one element.
[0041] After obtaining the target courseware, the automated courseware processing device needs to parse the courseware to identify all elements on each page and determine the first structured information of each element. Each page element refers to an object used to express content on that page. Page elements can be text, images, animations, etc. In this embodiment, each page includes at least one element, for example. Figure 2 As shown, Figure 2 In section 10, a screen is displayed on a certain page, which includes text 20 and images 30. Additionally, the first structured information of an element refers to information used to identify the element when it is displayed on the page, such as the element's type and its position on the page. In one embodiment, when the courseware automated processing device parses the target courseware, it can convert the target courseware into data in a preset format, and then parse the preset format data to determine the elements in each page and the first structured information corresponding to each element.
[0042] Step 103: Input the image into the preset target detection model to obtain the text structure information of the first text element corresponding to each page.
[0043] After obtaining the images corresponding to each page of the target courseware, the courseware automated processing device needs to further input the images of each page into a pre-set target detection model. In this embodiment, the target detection model is based on a neural network. After acquiring the images, the target detection model can analyze them, identify the first text element in each image, and extract the text structure information corresponding to each first text element. The first text element refers to the object that expresses content in text form. Similarly, the text structure information includes the function and position information of the first text element when it is displayed on the corresponding page. For example, the text structure information includes the hierarchy and position of the first text element; the hierarchy is used to characterize the role of the first text element in the overall text content.
[0044] Step 104: Based on the first structured information and the text structured information, determine the target structured information corresponding to the target courseware.
[0045] After obtaining the text structure information, the target structure information corresponding to the target courseware can be determined based on the first structure information of all elements in each page and the text structure information of the first text element in each page. The target structure information includes information about the distribution structure of all elements in the target courseware. In one embodiment, the courseware automated processing device can determine the relationship between the first text elements in the target courseware based on the hierarchy of the first text elements in each page, and then determine the target structure information corresponding to the target courseware based on the first structure information of all elements and the relationship between the first text elements.
[0046] Step 105: Process the target courseware based on the target structured information.
[0047] Finally, the automated courseware processing equipment can process the target courseware based on its target structured information. For example, the automated courseware processing equipment can automatically match a corresponding beautification template based on the target structured information of the target courseware. The beautification template includes parameters corresponding to each element. The automated courseware processing equipment can modify the parameters of each element on each page of the target courseware according to the parameters in the beautification template, such as adjusting the color, font, and font size of the first text element, thereby obtaining the beautified target courseware. The overall process is as follows: Figure 3 As shown.
[0048] For example, such as Figure 4As shown, Figure 4 This is a schematic diagram of the content of a page in the target courseware before it is processed. After acquiring the target courseware, the automated courseware processing equipment parses it to determine the initial structured information of all elements corresponding to each page of the target courseware. For example, in Figure 4 The page shown contains text elements. The courseware automation processing device parses the target courseware to obtain the first structured information of the text elements. At the same time, it inputs the image corresponding to each page of the target courseware into the target detection model to obtain the text structured information of the first text element (i.e., the text element).
[0049] Then, the automated courseware processing equipment determines the hierarchy of text elements based on the text's structured information, for example... Figure 4 The various levels of the first text element in Chinese, such as Figure 5 As shown, the hierarchy is either the heading level or the body text of the first text element. The relationships between text elements are then determined based on their hierarchy, for example... Figure 5 The main text text 1 belongs to the second-level heading 1, meaning that the text element corresponding to the main text text 1 is associated with the text element of the second-level heading 1. Finally, the automated courseware processing device can generate the target structured information of the target courseware based on the relationships between text elements and the first structured information of the text elements. Then, it matches the corresponding beautification template based on the target structured information and uses the beautification template to beautify the target courseware, for example... Figure 4 The page shown is a beautified version of the page. Figure 6 As shown.
[0050] As described above, in this embodiment of the invention, after obtaining the target courseware, the target courseware is parsed and input into a preset target detection model to obtain the first structured information of all elements in the target courseware and the text structured information of the first text elements. Then, based on the first structured information and the text structured information, the target structured information corresponding to the target courseware is determined, and the target courseware is processed according to the target structured information to obtain the beautified target courseware. This embodiment of the invention can automatically beautify the target courseware after obtaining it, without requiring human intervention, thus improving the beautification efficiency and solving the technical problem of low beautification efficiency in existing technologies.
[0051] like Figure 7 As shown, Figure 7 This is a flowchart illustrating another method for automating courseware processing provided in an embodiment of the present invention. Figure 7 The automated courseware processing method shown is a specific implementation of the above-mentioned automated courseware processing method, and the method includes:
[0052] Step 201: Obtain the target courseware and extract the images corresponding to each page of the target courseware.
[0053] Step 202: Convert the target courseware into target format data.
[0054] In this embodiment, after obtaining the target courseware, it is necessary to further convert the target courseware into target format data. Target format data refers to data in a pre-specified format. The specific type of the target format can be set according to actual needs and is not specifically limited in this embodiment. For example, the target courseware obtained by the automated courseware processing device is an XML (Extensible Markup Language) file. In this case, the XML file needs to be converted into JSON (JavaScript Object Notation) data format, which 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 be found in existing technologies and will not be described in detail in this embodiment.
[0055] Step 203: Parse the target format data to determine the first structured information of all elements corresponding to each page in the target courseware. Each page includes at least one element.
[0056] After converting the target courseware into target format data, the target format data can be parsed to determine the first structured information of all elements corresponding to each page in the target courseware. For example, when the target format data is in JSON format, the courseware automated processing device can index the elements based on fields to extract the position and content of all elements, thereby determining the first structured information of all elements.
[0057] Step 204: Input the image into the preset object detection model to obtain the text structure information of the first text element corresponding to each page, wherein the object detection model is trained based on the Mask-RCNN model.
[0058] In this embodiment, the object detection model uses the Mask-RCNN model, which is the culmination of the R-CNN series. Mask R-CNN is a small, flexible, and general-purpose object instance segmentation framework that can not only detect objects in images but also output high-quality segmentation results corresponding to each object. Specifically, after receiving the input image, the Mask R-CNN model first detects the locations of objects in the image and marks them in the image using candidate boxes. Then, the Mask R-CNN model further determines the category of the candidate boxes, identifying which pixels within each box are objects and which are simply background. Finally, it performs gradient descent using backpropagation to achieve both object detection and instance segmentation.
[0059] In one embodiment, during the training of the Mask R-CNN model, a large number of images corresponding to each page of the courseware are acquired, and the text elements in the images are annotated with corresponding text structure information. Then, the annotated images are divided into a training set and a validation set in a 6:4 ratio. The Mask R-CNN model is trained using the training set for N rounds. Simultaneously, during training, the performance of the Mask R-CNN model can be tested using the validation set. For example, after each round of training, the loss function value of the Mask R-CNN model is tested using the validation set. The Mask R-CNN model includes five loss functions: the classification and regression losses of the RPN (Region Proposal Network), the classification and regression losses of the MR-CNN (Multi-Region CNN), and the loss function of the MASK branch. After the validation set is input into the Mask R-CNN model, each of the five loss functions calculates a value; summing these five values yields the total loss function value of the Mask R-CNN model. Finally, the training completion status of the Mask R-CNN model can be determined based on the loss function value. For example, when the loss function value is less than a preset loss threshold, the Mask R-CNN model is considered to have completed training, resulting in an object detection model. Alternatively, the loss function values after each training round can be plotted graphically or tabularly, and the Mask R-CNN model with the smallest loss function value can be selected as the final object detection model. Subsequently, after inputting the image corresponding to each page of the target courseware into the object detection model, the model can output the text structure information of the first text element in the image.
[0060] Step 205: Based on the first structured information and the text structured information, determine the target structured information corresponding to the target courseware.
[0061] Step 206: Process the target courseware based on the target structured information.
[0062] As described above, in obtaining the text structure information of the first text element in the target courseware, this embodiment of the invention obtains the text structure information output by the target detection model by inputting the image corresponding to the target courseware into the object detection model built based on the Mask R-CNN model. This embodiment of the invention introduces the Mask R-CNN model into the courseware enhancement process, using it to detect and classify the text structure information of the text elements in the courseware. This improves the accuracy of determining the text structure information while simplifying the courseware enhancement process and increasing its efficiency.
[0063] like Figure 8 As shown, Figure 8 This is a flowchart illustrating another method for automating courseware processing provided in an embodiment of the present invention. Figure 8 The automated courseware processing method shown is a specific implementation of the above-mentioned automated courseware processing method, and the method includes:
[0064] Step 301: Obtain the target courseware and extract the images corresponding to each page of the target courseware.
[0065] Step 302: Analyze the target courseware and determine the first structured information of all elements corresponding to each page in the target courseware. Each page includes at least one element. The first structured information includes the element type, the element content, and the element's first position.
[0066] In this embodiment, the first structured information of an element includes the element's type, content, and first position. The element's type refers to its form of expression, such as text, image, or animation. The element's content is the information it conveys; for example, the content of a text element is each character within the text element. The element's first position includes the page on which the element is displayed, the size of the area occupied by the element on the page, and the location of that area. For example, the page on which the element is displayed can be represented by a page number, and the area occupied by the element can be represented by two-dimensional coordinates. The target courseware data records the two-dimensional coordinates corresponding to the area occupied by the element on the corresponding page. In one embodiment, the area occupied by the element on the page can be determined based on the element's bounding rectangle. Subsequently, only the two-dimensional coordinates of the four vertices of the element's bounding rectangle on the corresponding page need to be parsed to obtain the element's first position.
[0067] Step 303: Input the image into the preset target detection model to obtain the text structure information of the first text element corresponding to each page. The text structure information includes the hierarchy of the first text element and the second position of the first text element.
[0068] In addition, the text structure information of the first text element in this embodiment includes the hierarchy of the first text element and its second position. The hierarchy of the first text element represents its role within the overall text content of the target courseware. For example, the first text element may be a first-level heading, a second-level heading, or simply body text. The second position of the first text element refers to the size and location of the area it occupies on each page. In one embodiment, the automated courseware processing can sequentially input the corresponding images for each page into the target detection model according to the display order of each page in the target courseware. The subsequent automated courseware processing can then determine the page containing the first text element and its second position within that specific page based on the order in which the target detection model outputs the text structure information of the first text element.
[0069] Step 304: Determine the second text element from all elements based on the type of the first structured information.
[0070] After obtaining the first structured information of all elements and the text structured information of the first text element, the automated courseware processing device will filter out the second text element from all elements based on the type of the first structured information of all elements. Specifically, the automated courseware processing device can filter out elements of type "text" as the second text element from all elements.
[0071] Step 305: Based on the first position of the second text element and the second position of the first text element, determine the target first text element that corresponds to the second text element in the first text element.
[0072] After identifying the second text element among all elements, its first position can be obtained from its first structured information, and its second position can be obtained from its text structured information. Then, based on the first and second positions of the second and first text elements within each page, the target first text element corresponding to each second text element is matched within the first text elements. Specifically, it can be determined whether the first and second positions of the second and first text elements within the same page overlap. If so, it indicates that the first and second text elements are actually the same text element, meaning that the first text element is the target first text element corresponding to the second text element.
[0073] Based on the above embodiments, step 305, which determines the target first text element corresponding to the second text element in the first text element according to the first position of the second text element and the second position of the first text element, includes:
[0074] Step 3051: Calculate the overlap between the first position of the second text element and the second position of each first text element.
[0075] In one embodiment, when searching for a matching target first text element for a second text element, the overlap between the first position of the second text element and the second position of each first text element on the page is first calculated. It is understood that because the first and second positions of the same text element are obtained in different ways, even for the same text element, there may be discrepancies between the first and second positions, making them not completely identical. Therefore, it is necessary to calculate the overlap between the first and second positions to find the target first text element corresponding to each second text element. Specifically, the overlap between the two-dimensional coordinates of the outer rectangle of the first text element on the page and the two-dimensional coordinates of the outer rectangle of each second text element on the page can be calculated.
[0076] Step 3052: Take the first text element with the largest overlap as the target first text element corresponding to the second text element.
[0077] After calculating the overlap between the first position of each second text element and the second position of each first text element on each page, the first text element with the largest overlap with the first position of the second text element can be obtained. This first text element can then be used as the target first text element corresponding to the second text element. For example, the position of the bounding rectangle of a certain second text element 21 on the screen is as follows: Figure 9 As shown, Figure 9 The text also includes the outer rectangle of the first text element 23 and the outer rectangle of the first text element 24. At this time, by calculating the overlap between the outer rectangles, it is determined that the second text element 21 and the first text element 24 have the largest overlap, that is, the target first text element corresponding to the second text element 21 is the first text element 24.
[0078] Step 306: Assign the hierarchy of the target first text element to the corresponding second text element.
[0079] After identifying the target first text element corresponding to each second text element, the hierarchy of the target first text element is further assigned to the corresponding second text element.
[0080] Step 307: Based on the first structured information and hierarchy of the second text element, and the first structured information of other elements, determine the structured information corresponding to the target courseware.
[0081] After assigning the hierarchy of the first target element to the corresponding second text element, the structured information corresponding to the target courseware can be determined based on the first structured information and hierarchy of the second text element, as well as the first structured information of other elements besides the second text element.
[0082] Based on the above embodiments, the hierarchy corresponds to the heading level or the body text.
[0083] In one embodiment, the hierarchy of text elements corresponds to heading levels or to body text. Here, heading level refers to the level of the heading within the overall content of the courseware. For example, heading levels include first-level headings, second-level headings, and third-level headings, where a second-level heading is a subheading of a first-level heading, a third-level heading is a subheading of a second-level heading, and so on. For example... Figure 5 In the example, the first-level heading is "Class Summary," and the second-level headings are "1. Summary of the Text's Content" and "2. What Did You Feel After Reading the Text for the First Time?". When a heading corresponds to a first-level heading, it means that the text element is a first-level heading in the presentation; when it corresponds to a second-level heading, it means that the text element is a second-level heading, and so on. Additionally, the body text refers to the text element that serves as a subordinate content to the heading within the overall content of the presentation. For example... Figure 5The sentence "After reading this text, we truly felt the magnificence and grandeur of the Qiantang River tidal bore" is a subordinate content of the second-level heading. Furthermore, first-level headings do not require subordinate content.
[0084] In step 307, based on the first structured information and hierarchy of the second text element, and the first structured information of other elements, the structured information corresponding to the target courseware is determined, including:
[0085] Step 3071: In the second text element, determine the title text element whose level corresponds to the title level, and obtain the third position of the title text element.
[0086] When determining the target structured information of the target courseware, the relationship between the title and the body text in the second text element is not yet known. Therefore, in this embodiment, it is first necessary to determine the title text element corresponding to the level and title grade in the second text element, and then further obtain the third position of the title text element in the first structured information of the title text element in order to locate the title text element.
[0087] Step 3072: Determine the text element in the second text element that corresponds to the level of the main text, and obtain the fourth position of the main text element.
[0088] Similarly, in this embodiment, it is necessary to determine the text element corresponding to the level of the main text in the second text element, and obtain the fourth position of the main text element in the first structured information of the main text element.
[0089] Step 3073: Determine the relationship between the title text element and the body text element based on the third position of the title text element and the fourth position of the body text element.
[0090] After determining the third position of the title text element and the fourth position of the body text element, the association between the title text element and the body text element can be determined. This association indicates that the body text element is subordinate content of the title text element. In one embodiment, a text association region can be defined based on the third positions of two adjacent title text elements, and an association can be determined between the body text element located within the text association region and the first of the two adjacent title text elements.
[0091] Based on the above embodiments, step 3073 determines the association between the title text element and the body text element according to the third position of the title text element and the fourth position of the body text element, including:
[0092] Step 30731: Identify the target title text elements in the title text elements whose level does not correspond to the target title level.
[0093] In this embodiment, when determining the association between title text elements and body text elements, it is first necessary to identify target title text elements whose hierarchical level does not correspond to the target title level. The target title level is a pre-defined title level. In this embodiment, since a first-level title does not have a corresponding body text, the target title level can be set to a first-level title. Identifying target title text elements whose hierarchical level does not correspond to a first-level title is equivalent to identifying target title text elements whose hierarchical level corresponds to second-level, third-level, and so on title levels.
[0094] Step 30732: Determine the traversal order of the target title text element based on its third position.
[0095] After identifying the target title text element, the third position of the target title text element is obtained, and the traversal order of the target title text element is determined based on the third position. The traversal order refers to the order in which the target title text element is traversed subsequently. For example, the third position of the target title text element can be used to determine the order in which the target title text element appears in the target courseware, and the traversal order of the target title text element can be determined according to the order of appearance from earliest to latest.
[0096] Step 30733: Traverse the target title text elements sequentially according to the traversal order. Determine the text association area based on the third position of the currently traversed target title text element and the third position of the next target title text element.
[0097] After determining the traversal order, the target title text elements can be traversed sequentially. For the currently traversed target title text element, its third position is obtained. Simultaneously, the next target title text element is determined, and its third position is obtained. Then, based on the third positions of both the current and next target title text elements, the area between them is determined and designated as the text association area. Furthermore, it should be noted that if the currently traversed target title text element and the next target title text element are not located on the same page of the target courseware, the text association area can be set across pages. For example, as shown... Figure 10 As shown, 40 and 50 are the contents displayed on two adjacent pages. The text association area between the second-level heading 1 and the second-level heading 2 includes area A and area B. At this time, the two-dimensional coordinates of area A and area B can be obtained on the two pages respectively, so as to determine the text association area.
[0098] Step 30734: Based on the fourth position of the main text element, determine the target main text element located in the text association area, and determine the association relationship between the target main text element and the currently traversed target title text element.
[0099] After identifying the text association region, the target text element located within the region can be determined based on the fourth position of the main text element. A relationship between this target text element and the currently traversed target title text element can then be established; that is, the target text element is a subordinate content of the currently traversed target title text element. After traversing all target title text elements, the target text elements associated with each target title text element can be identified.
[0100] Furthermore, in certain special cases, such as when a second-level heading in the target courseware includes both third-level heading 1 and third-level heading 2, and a summary of the second-level heading appears after the body text of third-level heading 2, the above method of determination might mistakenly identify the summary as related to third-level heading 2. Therefore, to avoid this, an object detection model can be used to identify the summary text element in the target courseware that corresponds to the summary content, and the hierarchy of the summary text element can be set to correspond to the summary content. This way, when a summary text element is subsequently identified after third-level heading 2, the relationship between the summary text element and the second-level heading can be directly determined.
[0101] The above is the specific process for determining the relationship between title text elements and body text elements.
[0102] Step 3074: Based on the first structured information of the title text element and its hierarchy, the first structured information of the body text element, the relationship between the title text element and the body text element, and the first structured information of other elements, determine the target structured information corresponding to the target courseware.
[0103] After confirming the relationship between the title text element and the body text element, the target structured information corresponding to the target courseware can be determined based on the first structured information and hierarchy of the title text element, the first structured information of the body text element, the relationship between the title text element and the body text element, and the first structured information of other elements.
[0104] Step 308: Based on the target structured information, obtain the corresponding target processing template from the preset processing template library, and process the target courseware according to the target processing template. The processing template library includes multiple processing templates.
[0105] Finally, based on the target structured information, the corresponding target processing template can be obtained from the preset processing template library. The processing template library is a database containing multiple processing templates, each corresponding to a target structured information. Processing templates can be pre-stored by the user in the processing template library, or the processing template library can automatically download and update them from the server.
[0106] Once the target processing template is obtained, it can be used to process the target courseware. For example, the target processing template includes colors, fonts, and font sizes corresponding to different heading levels. When processing the target courseware using the target processing template, the colors, fonts, and font sizes corresponding to each heading level can be obtained, and the corresponding heading text elements and the body text elements related to the heading text elements can be modified and saved to obtain the processed target courseware, thus completing the beautification process of the target courseware.
[0107] As described above, in this embodiment of the invention, after obtaining the text structure information of the first text element, the hierarchy of the first text element is further assigned to the second text element. Then, the element type is further determined, distinguishing between title text elements and body text elements within the second text element, and establishing the association between the body text elements and the title text elements to subsequently determine the target structure information of the target courseware. Finally, the target courseware is processed by matching the corresponding target processing template based on the target structure information, thereby completing the beautification process of the target courseware. In this embodiment of the invention, the method of identifying the hierarchy and second position of the first text element using a target detection model effectively avoids the problem of inaccurate segmentation when dividing based on rules such as distance. Furthermore, by determining the hierarchy of the title text element and the body text elements associated with it, this embodiment of the invention allows for the assignment of different attributes to title text elements and body text elements at different levels in the target courseware during the subsequent beautification process, thereby making the target courseware page more aesthetically pleasing. In this invention, when beautifying target courseware, users are not required to manually select templates. Manual selection typically involves users viewing the beautification results and comparing the effects of different templates, which is not only difficult to select but also time-consuming, resulting in low beautification efficiency. This invention, by automatically beautifying courseware, improves beautification efficiency and solves the technical problem of low beautification efficiency in existing technologies.
[0108] like Figure 11 As shown, Figure 11 This is a schematic diagram of the structure of an automated courseware processing device provided in an embodiment of the present invention. The device includes:
[0109] The courseware acquisition module 401 is used to acquire the target courseware and extract the images corresponding to each page of the target courseware.
[0110] The courseware parsing module 402 is used to parse the target courseware and determine the first structured information of all elements corresponding to each page in the target courseware. Each page includes at least one element.
[0111] The model analysis module 403 is used to input images into a preset target detection model to obtain the text structure information of the first text element corresponding to each page.
[0112] The information acquisition module 404 is used to determine the target structured information corresponding to the target courseware based on the first structured information and the text structured information.
[0113] The courseware automation processing module 405 is used to process the target courseware based on the target structured information.
[0114] Based on the above embodiments, the courseware parsing module 402 includes:
[0115] The format conversion submodule is used to convert the target courseware into target format data.
[0116] The data parsing submodule is used to parse the target format data and determine the first structured information of all elements corresponding to each page in the target courseware.
[0117] Based on the above embodiments, the object detection model is trained on the Mask-RCNN model.
[0118] Based on the above embodiments, the first structured information includes the type of the element, the content of the element, and the first position of the element, and the text structured information includes the hierarchy of the first text element and the second position of the first text element.
[0119] Information acquisition module 404 includes:
[0120] The second text element determination submodule is used to determine the second text element among all elements based on the type of the first structured information.
[0121] The text element matching submodule is used to determine the target first text element corresponding to the second text element in the first text element based on the first position of the second text element and the second position of the first text element.
[0122] The hierarchy assignment submodule is used to assign the hierarchy of the target first text element to the corresponding second text element.
[0123] The structured information determination submodule is used to determine the structured information corresponding to the target courseware based on the first structured information and hierarchy of the second text element, as well as the first structured information of other elements.
[0124] Based on the above embodiments, the text element matching submodule includes:
[0125] The overlap calculation unit is used to calculate the overlap between the first position of the second text element and the second position of each first text element.
[0126] The text element matching unit is used to identify the first text element with the highest overlap as the target first text element corresponding to the second text element.
[0127] Based on the above embodiments, the hierarchy corresponds to the heading level or the body text.
[0128] The structured information determination submodule includes:
[0129] The third position determination unit is used to determine the title text element in the second text element that corresponds to the title level, and to obtain the third position of the title text element.
[0130] The fourth position determination unit is used to determine the text element corresponding to the level of the main text in the second text element and obtain the fourth position of the main text element.
[0131] The association determination unit is used to determine the association between the title text element and the body text element based on the third position of the title text element and the fourth position of the body text element.
[0132] The structured information determination unit is used to determine the target structured information corresponding to the target courseware based on the first structured information of the title text element, the first structured information of the hierarchy and body text elements, the relationship between the title text element and the body text element, and the first structured information of other elements.
[0133] Based on the above embodiments, the association determination unit includes:
[0134] The target element identifies sub-units used to identify target title text elements within title text elements whose level does not correspond to the target title level.
[0135] The traversal order determines the sub-cells, which is used to determine the traversal order of the target title text element based on its third position.
[0136] The associated region determination sub-unit is used to traverse the target title text elements sequentially according to the traversal order, and determine the text associated region based on the third position of the currently traversed target title text element and the third position of the next target title text element.
[0137] The associated text determination sub-unit is used to determine the target text element located in the text association area based on the fourth position of the main text element, and to determine the association relationship between the target text element and the currently traversed target title text element.
[0138] Based on the above embodiments, the courseware automation processing module 405 is specifically used to obtain the corresponding target processing template from the preset processing template library according to the target structured information, and process the target courseware according to the target processing template. The processing template library includes multiple processing templates.
[0139] The courseware automated processing device provided in this embodiment of the invention is included in the courseware automated processing equipment and can be used to execute the courseware automated processing method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0140] It is worth noting that in the embodiments of the above-mentioned courseware automated processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0141] This embodiment also provides an automated courseware processing device, such as... Figure 12 As shown, the courseware automated processing device 50 includes a processor 500 and a memory 501;
[0142] The memory 501 is used to store the computer program 502 and to transfer the computer program 502 to the processor 500;
[0143] The processor 500 is used to execute the steps in the above-described embodiment of an automated courseware processing method according to the instructions in the computer program 502.
[0144] For example, computer program 502 can be divided into one or more modules / units, one or more modules / units are stored in memory 501 and executed by processor 500 to complete this application. One or more modules / units can be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 502 in courseware automation processing device 50.
[0145] The courseware automated processing device 50 can be a desktop computer, laptop, handheld computer, or cloud server, etc. The courseware automated processing device 50 may include, but is not limited to, a processor 500 and a memory 501. Those skilled in the art will understand that... Figure 12 This is merely an example of the courseware automation processing device 50 and does not constitute a limitation on the courseware automation processing device 50. It may include more or fewer components than shown, or combine certain components, or different components. For example, the courseware automation processing device 50 may also include input / output devices, network access devices, buses, etc.
[0146] The processor 500 may be a Central Processing Unit (CPU), or other general-purpose processors, 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, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0147] The memory 501 can be an internal storage unit of the courseware automation processing device 50, such as a hard disk or RAM of the courseware automation processing device 50. The memory 501 can also be an external storage device of the courseware automation processing device 50, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the courseware automation processing device 50. Furthermore, the memory 501 can include both internal and external storage units of the courseware automation processing device 50. The memory 501 is used to store computer programs and other programs and data required by the courseware automation processing device 50. The memory 501 can also be used to temporarily store data that has been output or will be output.
[0148] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0149] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0150] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0151] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0152] If the integrated unit is implemented as 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing computer programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0153] This invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform an automated courseware processing method, the method comprising the following steps:
[0154] Obtain the target courseware and extract the images corresponding to each page of the target courseware;
[0155] The target courseware is parsed to determine the first structured information of all elements corresponding to each page in the target courseware, and each page includes at least one element;
[0156] The image is input into the preset target detection model to obtain the text structure information of the first text element corresponding to each page;
[0157] Based on the first structured information and the text structured information, determine the target structured information corresponding to the target courseware;
[0158] The target courseware is processed based on the target structured information.
[0159] Note that the above are merely preferred embodiments and the technical principles applied in this invention. Those skilled in the art will understand that the embodiments of this invention are not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the protection scope of this invention. Therefore, although the embodiments of this invention have been described in detail above, the embodiments of this invention are not limited to the above embodiments. More other equivalent embodiments may be included without departing from the concept of the embodiments of this invention, and the scope of the embodiments of this invention is determined by the scope of the appended claims.
Claims
1. A method for automating courseware processing, characterized in that, include: Obtain the target courseware and extract the images corresponding to each page of the target courseware; The target courseware is parsed to determine the first structured information of all elements corresponding to each page in the target courseware. Each page includes at least one element. The first structured information includes the type of the element, the content of the element, and the first position of the element. The image is input into a preset target detection model to obtain the text structure information of the first text element corresponding to each page. The text structure information includes the hierarchy of the first text element and the second position of the first text element. The hierarchy of the first text element is used to characterize the role of the first text element in the overall text content expressed by the target courseware. Based on the first structured information and the text structured information, determine the target structured information corresponding to the target courseware; The target courseware is processed based on the target structured information; The step of determining the target structured information corresponding to the target courseware based on the first structured information and the text structured information includes: Based on the type of the first structured information, a second text element is determined from all the elements; Based on the first position of the second text element and the second position of the first text element, determine the target first text element corresponding to the second text element in the first text element; Assign the hierarchy of the target first text element to the corresponding second text element; Based on the first structured information of the second text element, the hierarchy, and the first structured information of other elements, the target structured information corresponding to the target courseware is determined.
2. The method for automated processing of courseware according to claim 1, characterized in that, The step of parsing the target courseware to determine the first structured information of all elements corresponding to each page in the target courseware includes: Convert the target courseware into target format data; The target format data is parsed to determine the first structured information of all elements corresponding to each page in the target courseware.
3. The method for automated processing of courseware according to claim 1, characterized in that, The object detection model is trained based on the Mask-RCNN model.
4. The method for automated processing of courseware according to claim 1, characterized in that, The step of determining the target first text element corresponding to the second text element in the first text element based on the first position of the second text element and the second position of the first text element includes: Calculate the overlap between the first position of the second text element and the second position of each of the first text elements; The first text element with the highest overlap is taken as the target first text element corresponding to the second text element.
5. The method for automated processing of courseware according to claim 1, characterized in that, The hierarchy corresponds to the heading level or to the body text; The step of determining the target structured information corresponding to the target courseware based on the first structured information of the second text element, the hierarchy, and the first structured information of other elements includes: In the second text element, determine that the level is a title text element corresponding to the title level, and obtain the third position of the title text element; In the second text element, determine the text element corresponding to the level and the text element, and obtain the fourth position of the text element; The association between the title text element and the body text element is determined based on the third position of the title text element and the fourth position of the body text element. Based on the first structured information and hierarchy of the title text element, the first structured information of the body text element, the relationship between the title text element and the body text element, and the first structured information of other elements, the target structured information corresponding to the target courseware is determined.
6. The method for automated processing of courseware according to claim 5, characterized in that, Determining the association between the title text element and the body text element based on the third position of the title text element and the fourth position of the body text element includes: Identify, within the title text elements, target title text elements whose level does not correspond to the target title level; The traversal order of the target title text element is determined based on its third position. The target title text elements are traversed sequentially according to the traversal order. The text association area is determined based on the third position of the currently traversed target title text element and the third position of the next target title text element. Based on the fourth position of the main text element, the target main text element located in the text association area is determined, and an association relationship is determined between the target main text element and the currently traversed target title text element.
7. The method for automated processing of courseware according to claim 1, characterized in that, The process of processing the target courseware based on the target structured information includes: Based on the target structured information, a corresponding target processing template is obtained from a preset processing template library, and the target courseware is processed according to the target processing template. The processing template library includes multiple processing templates.
8. An automated courseware processing device, characterized in that, include: The courseware acquisition module is used to acquire target courseware and extract images corresponding to each page of the target courseware. The courseware parsing module is used to parse the target courseware and determine the first structured information of all elements corresponding to each page in the target courseware. Each page includes at least one element, and the first structured information includes the type of the element, the content of the element, and the first position of the element. The model analysis module is used to input the image into a preset target detection model to obtain the text structure information of the first text element corresponding to each page. The text structure information includes the hierarchy of the first text element and the second position of the first text element. The hierarchy of the first text element is used to characterize the role of the first text element in the overall text content expressed by the target courseware. The information acquisition module is used to determine the target structured information corresponding to the target courseware based on the first structured information and the text structured information; An automated courseware processing module is used to process the target courseware based on the target structured information; The information acquisition module includes: The second text element determination submodule is used to determine the second text element among all elements based on the type of the first structured information; The text element matching submodule is used to determine the target first text element corresponding to the second text element in the first text element based on the first position of the second text element and the second position of the first text element; The hierarchy assignment submodule is used to assign the hierarchy of the target first text element to the corresponding second text element; The structured information determination submodule is used to determine the target structured information corresponding to the target courseware based on the first structured information of the second text element, the hierarchy, and the first structured information of other elements.
9. An automated courseware processing device, characterized in that, The automated courseware processing device includes a processor and a memory; The memory is used to store computer programs and to transfer the computer programs to the processor; The processor is used to execute a courseware automation processing method as described in any one of claims 1-7 according to instructions in the computer program.
10. A storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform an automated courseware processing method as described in any one of claims 1-7.
Citation Information
Patent Citations
Slide processing method and device and electronic equipment
CN114254610A
Powerpoint conversion method and device, equipment and storage medium
CN115034177A