Courseware automatic processing method and device, equipment and storage medium
By automatically processing the structured information of the courseware and using the target detection model to beautify the courseware, the problem of low efficiency of courseware beautification in the existing technology is solved, and an efficient and automatic courseware beautification process is realized.
Patent Information
- Application Number
- CN202310344274.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-03-31
AI Technical Summary
The courseware beautification efficiency in the existing technology is low, it relies on manual selection of templates, and the beautification effect is unsatisfactory.
By obtaining the courseware, extract the pictures of each page and input the preset target detection model to obtain the structured information, automatically match the beautification template for processing, and realize the automatic beautification of the courseware.
It improves the efficiency of courseware beautification, reduces human participation, and ensures the consistency and quality of the beautification effect.
Smart Images

Figure CN118736611A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of automated office work, and in particular to a method, device, equipment and storage medium for automated courseware processing. Background Art
[0002] At present, with the mass popularization of computers and the development of multimedia technology, the use of multimedia to carry out teaching and other work has gradually become a trend, and courseware is a more important form of file display in multimedia technology. Courseware can intuitively and vividly present the content to be expressed to students in the form of text, graphics, colors and animation. However, making a beautiful courseware requires experience and good aesthetics. At present, courseware is mainly beautified by manual methods, and the beautification efficiency is low.
[0003] To sum up, how to improve the efficiency of courseware beautification has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The embodiment of the present invention provides a courseware automatic processing method, device, equipment and storage medium. The embodiment of the present invention can improve the beautification efficiency of the courseware and solve the technical problem of low beautification efficiency of the courseware in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a courseware automation processing method, comprising:
[0006] Get the target courseware and extract the pictures corresponding to each page of the target courseware;
[0007] Parsing the target courseware to determine first structural information of all elements corresponding to each page in the target courseware, each page including at least one element;
[0008] Input the image into a preset object detection model to obtain text structured information of the first text element corresponding to each page;
[0009] Determining target structured information corresponding to the target courseware according to the first structured information and the text structured information;
[0010] Process the target courseware according to the target structured information.
[0011] In a second aspect, an embodiment of the present invention provides a courseware automation processing device, including:
[0012] The courseware acquisition module is used to acquire the target courseware and extract the pictures corresponding to each page of the target courseware;
[0013] The courseware parsing module is used to parse the target courseware and determine the first structural information of all elements corresponding to each page in the target courseware, where each page includes at least one element;
[0014] A model analysis module, used to input the image into a preset object detection model to obtain text structured information of the first text element corresponding to each page;
[0015] An information acquisition module, used to determine target structured information corresponding to the target courseware according to the first structured information and the text structured information;
[0016] The courseware automation processing module is used to process the target courseware according to the target structured information.
[0017] In a third aspect, an embodiment of the present invention provides a courseware automation processing device, the courseware automation processing device includes 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 automation processing method as described in the first aspect according to instructions in the 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 method for automated courseware processing as in the first aspect.
[0021] As described above, after acquiring the target courseware, the embodiment of the present invention parses the target courseware and inputs the target courseware into a preset target detection model, thereby respectively obtaining the first structured information of all elements in the target courseware and the text structured information of the first text element, and then determining the target structured information corresponding to the target courseware based on the first structured information and the text structured information, and processing the target courseware based on the target structured information, thereby obtaining the beautified target courseware. After acquiring the target courseware, the embodiment of the present invention can automatically beautify the target courseware, and no human participation is required in this process, thereby improving the beautification efficiency of the courseware and solving the technical problem of low beautification efficiency of the courseware in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic flow chart of a method for automatic courseware processing provided in an embodiment of the present invention.
[0023] Figure 2 A schematic diagram of elements included in a page of a courseware provided in an embodiment of the present invention.
[0024] Figure 3 A schematic diagram of the principles of a method for automatic courseware processing provided by an embodiment of the present invention.
[0025] Figure 4 A schematic diagram of the contents of a page in the target courseware provided in an embodiment of the present invention.
[0026] Figure 5 A schematic diagram of the hierarchy of the first text element of a page in the target courseware provided in an embodiment of the present invention.
[0027] Figure 6 A schematic diagram of the result of beautifying a page provided by an embodiment of the present invention.
[0028] Figure 7 A flowchart of another method for automatic courseware processing provided by an embodiment of the present invention.
[0029] Figure 8 A flowchart of another method for automatic courseware processing provided by an embodiment of the present invention.
[0030] Fig. 9 A schematic diagram of calculating overlap provided by an embodiment of the present invention.
[0031] Fig.10 A schematic diagram of setting text association areas across pages provided by an embodiment of the present invention.
[0032] Fig.11 A schematic diagram of the structure of a courseware automation processing device provided in an embodiment of the present invention.
[0033] Fig.12 A structural schematic diagram of a courseware automation processing device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] 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.
[0035] At present, when users beautify courseware, they generally beautify the courseware by setting templates. Specifically, users need to select a corresponding template for each page content of the courseware, and then the software beautifies each page content of the courseware according to the template selected by the user. In the beautification process, users need to manually select templates, and the beautification efficiency is low. In addition, the selection of templates also depends on the user's experience and aesthetic taste. In some cases, the beautification effect of the courseware is not satisfactory.
[0036] In summary, in order to solve the technical problem of low efficiency in beautifying courseware in the prior art, the embodiment of the present invention discloses a method for automatic courseware processing. Figure 1 As shown, Figure 1 A flowchart of a courseware automation processing method provided by an embodiment of the present invention. The courseware automation processing method provided by an embodiment of the present invention can be executed by a courseware automation processing device, which can be implemented by software and / or hardware. The courseware automation processing device can be composed of two or more physical entities, or can be composed of one physical entity. For example, the courseware automation processing device can be a computer, a mobile phone, or a tablet. The method includes the following steps:
[0037] Step 101: Get the target courseware and extract the pictures corresponding to each page of the target courseware.
[0038] In this embodiment, the courseware automation processing device first needs to obtain the target courseware, where the target courseware refers to the courseware specified by the user. The method of obtaining the target courseware can be set according to actual needs and is not specifically limited in this embodiment. Exemplarily, the courseware automation processing device can obtain the target courseware from a local storage path pre-specified by the user, or the courseware automation processing device obtains the target courseware from the cloud through a server.
[0039] After acquiring the target courseware, the courseware automation processing device needs to further extract the pictures corresponding to each page of the target courseware. Specifically, the courseware automation processing device can parse the target courseware, determine the screen displayed when each page of the target courseware is displayed on the screen, and generate pictures corresponding to the screen, so as to obtain pictures corresponding to each page. In another embodiment, the courseware automation processing device can also directly open the target courseware, and take screenshots of the contents of each page of the target courseware displayed on the screen in turn, so as to obtain pictures corresponding to each page of the target courseware.
[0040] Step 102: parse the target courseware to determine the first structured information of all elements corresponding to each page in the target courseware, where each page includes at least one element.
[0041] After obtaining the target courseware, the courseware automation processing device also needs to parse the target courseware to identify all elements of each page in the target courseware and confirm the first structural information of each element. The elements of each page refer to the objects used to express the content on each page. The elements of the page can be text, pictures, animations, etc. In this embodiment, each page includes at least one element. Figure 2 As shown, Figure 2 10 is a screen displayed by a certain page, and the elements included in the page include text 20 and picture 30. In addition, the first structured information of the element refers to information used to identify the element when the element is displayed in the page, such as the type of the element and the position of the element in the page. In one embodiment, when parsing the target courseware, the courseware automation processing device can 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, and determine the first structured information corresponding to each element.
[0042] Step 103: input the image into a preset object detection model to obtain text structured information of the first text element corresponding to each page.
[0043] After obtaining the pictures corresponding to each page of the target courseware, the courseware automation processing device needs to further input the pictures 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 pictures, the target detection model can analyze the pictures, identify the first text element in each picture, and extract the text structured information corresponding to each first text element. Among them, the first text element refers to an object that expresses content in the form of text. Similarly, the text structured information includes the role of the first text element and the position information of the first text element when the first text element is displayed in the corresponding page. For example, the text structured information includes the level and position of the first text element, and the level is used to characterize the role of the first text element in the overall text content.
[0044] Step 104: Determine target structured information corresponding to the target courseware according to the first structured information and the text structured information.
[0045] After obtaining the text structured information, the target structured information corresponding to the target courseware can be determined based on the first structured information of all elements in each page and the text structured information of the first text element in each page, wherein the target structured information includes information on the distribution structure of all elements in the target courseware. In one embodiment, the courseware automation processing device can determine the association 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 structured information corresponding to the target courseware based on the first structured information of all elements and the association between the first text elements.
[0046] Step 105: Process the target courseware according to the target structured information.
[0047] Finally, the courseware automation processing device can process the target courseware according to the target structured information of the target courseware. Exemplarily, the courseware automation processing device can automatically match the corresponding beautification template according to the target structured information of the target courseware. The beautification template includes parameters corresponding to each element. The courseware automation processing device can modify the parameters of the elements of each page in 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, so as to obtain the beautified target courseware. The overall process is as follows: Figure 3 shown.
[0048] For example, Figure 4As shown, Figure 4 It is a schematic diagram of the content of a certain page in the target courseware before the target courseware is processed. After acquiring the target courseware, the courseware automation processing device parses the target courseware and determines the first structural information of all elements corresponding to each page of the target courseware. Figure 4 In the page shown, the parsed elements are all text elements. The courseware automation processing equipment parses the target courseware to obtain the first structured information of the text elements. At the same time, the image corresponding to each page of the target courseware is input into the target detection model to obtain the text structured information of the first text element (i.e., the text element).
[0049] Afterwards, the courseware automation processing device determines the level of text elements based on the text structure information, e.g. Figure 4 The various levels of the first text element in Figure 5 As shown, the level is the title level or body text of the first text element. Then, the association relationship of the text elements is determined according to the level of the text elements, for example Figure 5 The main text 1 belongs to the secondary title 1, that is, the text element corresponding to the main text 1 is associated with the text element of the secondary title 1. Finally, the courseware automation processing device can generate the target structured information of the target courseware according to the association relationship between the text elements and the first structured information of the text elements, match the corresponding beautification template according to the target structured information, and use the beautification template to beautify the target courseware, for example Figure 4 The page shown is beautified as follows Figure 6 shown.
[0050] As described above, after acquiring the target courseware, the embodiment of the present invention parses the target courseware and inputs the target courseware into a preset target detection model, thereby respectively obtaining the first structured information of all elements in the target courseware and the text structured information of the first text element, and then determining the target structured information corresponding to the target courseware based on the first structured information and the text structured information, and processing the target courseware based on the target structured information, thereby obtaining the beautified target courseware. After acquiring the target courseware, the embodiment of the present invention can automatically beautify the target courseware, and no human participation is required in this process, thereby improving the beautification efficiency of the courseware and solving the technical problem of low beautification efficiency of the courseware in the prior art.
[0051] like Figure 7 As shown, Figure 7 A flowchart of another method for automating courseware processing provided by an embodiment of the present invention is provided. Figure 7 The courseware automation processing method shown is a specific embodiment of the above-mentioned courseware automation processing method, and the method includes:
[0052] Step 201: Get the target courseware and extract the pictures corresponding to each page of the target courseware.
[0053] Step 202: Convert the target courseware into target format data.
[0054] 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 automation processing 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.
[0055] Step 203: parse the target format data to determine the first structural information of all elements corresponding to each page in the target courseware, where each page includes at least one element.
[0056] After the target courseware is converted into the 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. Exemplarily, when the target format data is in JSON format, the courseware automation processing device can index the elements according to the fields, thereby extracting information such as the location and content of all elements, and determining the first structured information of all elements.
[0057] Step 204: input the image into a preset target detection model to obtain text structured information of the first text element corresponding to each page, wherein the target detection model is trained based on the Mask-RCNN model.
[0058] In this embodiment, the target detection model adopts the Mask-RCNN model, in which the Mask R-CNN model is the culmination of the R-CNN series of models. Mask R-CNN is a compact and flexible general object instance segmentation framework (objectinstance segmentation), which can not only detect targets in images, but also output high-quality segmentation results corresponding to each target. Specifically, after receiving the input image, the Mask R-CNN model will first detect the location of the object in the image, and mark the object in the image by means of a candidate box. After that, the Mask-RCNN model will further determine the category of the candidate box, and determine which pixels in the candidate box are objects and which pixels are pure backgrounds, and finally perform gradient descent through the back-propagation technology to achieve the functions of target detection and instance segmentation.
[0059] In one embodiment, in the process of training the Mask R-CNN model, a large number of pictures corresponding to each page of the courseware can be obtained, and the corresponding text structured information is marked for the text elements in the pictures. Afterwards, the marked pictures are divided into a training set and a validation set in a ratio of 6:4, and the Mask R-CNN model is trained using the training set for N rounds. At the same time, during the training process, the performance of the Mask R-CNN model can be tested using the validation set, for example, after each round of training is completed, the loss function value of the Mask R-CNN model is tested using the validation set. Among them, the Mask R-CNN model includes 5 loss functions, namely, the classification loss and regression loss of the RPN network (Region Proposal Network, regional candidate network), the classification loss and regression loss of the MR-CNN network (Multi-Region CNN, multi-region CNN network), and the loss function of the MASK (mask) branch. After the validation set is input into the Mask R-CNN model, the 5 loss functions will calculate a value, and the loss function value of the Mask R-CNN model can be obtained by adding the 5 values. Finally, the loss function value can be used to determine whether the Mask R-CNN model has been trained. For example, when the loss function value is less than the preset loss threshold, the Mask R-CNN model can be judged to be trained and the target detection model can be obtained. Alternatively, the corresponding loss function value after each round of training can be plotted in a graphical or tabular form, and the Mask R-CNN model with the smallest loss function value can be selected as the final target detection model. After the image corresponding to each page of the target courseware is input into the target detection model, the target detection model can output the text structured information of the first text element in the image.
[0060] Step 205: Determine target structured information corresponding to the target courseware according to the first structured information and the text structured information.
[0061] Step 206: Process the target courseware according to the target structured information.
[0062] As described above, when acquiring the text structured information of the first text element in the target courseware, the embodiment of the present invention can obtain the text structured information output by the target detection model by inputting the picture corresponding to the target courseware into the target detection model constructed based on the Mask R-CNN model. The embodiment of the present invention introduces the Mask R-CNN model into the beautification of the courseware, and uses the Mask R-CNN model to detect and classify the text structured information of the text elements in the courseware. While improving the accuracy of determining the text structured information, it can simplify the process of beautifying the courseware and improve the efficiency of beautifying the courseware.
[0063] like Figure 8 As shown, Figure 8 A flowchart of another method for automating courseware processing provided by an embodiment of the present invention is provided. Figure 8 The courseware automation processing method shown is a specific embodiment of the above-mentioned courseware automation processing method, and the method includes:
[0064] Step 301: Get the target courseware and extract the pictures corresponding to each page of the target courseware.
[0065] Step 302: parse 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. The first structured information includes the type of element, the content of the element and the first position of the element.
[0066] In this embodiment, the first structured information of the element includes the type of the element, the content of the element and the first position of the element. The type of the element is the expression form of the element, such as the type of text, picture or animation. The content of the element is the information that the element needs to express, such as the content of the text element is each character in the text element. The first position of the element includes the page where the element is located when the element is displayed on the page, and the size of the area occupied by the element in the page and the position of the area. Exemplarily, the page where the element is located can be represented by the number of pages, and the area occupied by the element can be represented by the two-dimensional coordinate method. The data of the target courseware records the two-dimensional coordinates corresponding to the area occupied by the element in the corresponding page when the element is displayed on the corresponding page. In one embodiment, the area occupied by the element in the page can be determined according to the bounding rectangle of the element, and the first position of the element can be obtained by parsing the two-dimensional coordinates of the four vertices of the bounding rectangle of the element in the corresponding page.
[0067] Step 303: input the image into a preset target detection model to obtain text structured information of the first text element corresponding to each page, wherein the text structured information includes the level of the first text element and the second position of the first text element.
[0068] In addition, in the present embodiment, the text structured information of the first text element includes the level of the first text element and the second position of the first text element. The level 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. For example, the first text element is a first-level title, a second-level title, or just the main text in the overall text content. In addition, the second position of the first text element refers to the size of the area occupied by the first text element in each page and the position of the area. In one embodiment, the courseware automation processing can input the pictures corresponding to each page into the target detection model in sequence according to the display order of each page in the target courseware. The subsequent courseware automation processing can determine the page where the first text element is located and the second position of the first text element in the specific page according to the order in which the text structured information of the first text element is output by the target detection model.
[0069] Step 304: Determine a second text element from all elements according to 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 courseware automation processing device will filter out the second text element from all elements according to the type of the first structured information of all elements. Specifically, the courseware automation processing device can filter out the element of type text from all elements as the second text element.
[0071] Step 305: Determine a 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.
[0072] After the second text element is determined among all elements, the first position of the second text element can be further obtained in the first structured information of the second text element, and the second position of the first text element can be obtained in the text structured information of the first text element. Then, according to the first position of the second text element in each page and the second position of the first text element in each page, the target first text element corresponding to each second text element is matched in the first text element. Specifically, it can be determined whether the first position of the second text element and the second position of the first text element in the same page coincide with each other. If so, it means that the first text element and the second text element are actually the same text element, that is, the first text element is the target first text element corresponding to the second text element.
[0073] Based on the above embodiment, determining a 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 in step 305 includes:
[0074] Step 3051: Calculate the degree of 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, first calculate the overlap between the first position of the second text element and the second position of each first text element in each page. It is understandable that, since the first position and the second position of the same text element are obtained in different ways, even for the same text element, there may be a deviation between the first position and the second position, and they cannot be exactly the same. It is necessary to find the target first text element corresponding to each second text element by calculating the overlap between the first position and the second position. Specifically, the overlap between the two-dimensional coordinates of the outer bounding rectangle of the first text element in the page and the two-dimensional coordinates of the circumscribed rectangle of each second text element in the page can be calculated.
[0076] Step 3052: Use 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 in each page, the first text element with the largest overlap with the first position of the second text element can be obtained, and the first text element can be used as the target first text element corresponding to the second text element. Fig. 9 As shown, Fig. 9 The circumscribed rectangle of the first text element 23 and the circumscribed rectangle of the first text element 24 are also included. At this time, by calculating the overlap between the circumscribed rectangles, it is determined that the overlap between the second text element 21 and the first text element 24 is the largest, 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 level of the target first text element to the corresponding second text element.
[0079] After determining the target first text element corresponding to each second text element, the level of the target first text element is further assigned to the corresponding second text element.
[0080] Step 307: Determine the structured information corresponding to the target courseware according to the first structured information and the level of the second text element and the first structured information of other elements.
[0081] After assigning the level of the target first element to the corresponding second text element, the structural information corresponding to the target courseware can be determined based on the first structural information and level of the second text element and the first structural information of other elements except the second text element.
[0082] Based on the above embodiment, the hierarchy corresponds to the title level or to the body text.
[0083] In one embodiment, the level of the text element corresponds to the title level or to the body text. The title level refers to the level of the title in the overall content of the courseware. For example, the title level includes the first-level title, the second-level title, and the third-level title, where the second-level title is the subtitle of the first-level title, the third-level title is the subtitle of the second-level title, and so on. Figure 5 In the courseware, the first-level title is "Classroom Summary", and the second-level titles are "1. Summary of the content of the text" and "2. What do you feel after reading the text for the first time?" When the level corresponds to the first-level title, it means that the text element is a first-level title in the courseware. When the level corresponds to the second-level title, it means that the text element is a second-level title in the courseware, and so on. In addition, the body text refers to the text element that acts as a subordinate content of the title in the overall content of the courseware, for example Figure 5"After reading this text, we can truly feel the magnificence and grandeur of the Qiantang River Tide" is the subordinate content of the second-level title. In addition, the first-level title does not need subordinate content.
[0084] In step 307, the structured information corresponding to the target courseware is determined according to the first structured information and the level of the second text element and the first structured information of other elements, including:
[0085] Step 3071: Determine in the second text element a 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, since the association between the title and the body text in the second text element is not known yet, in this embodiment, it is first necessary to determine the title text element whose level corresponds to the title level 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, so as to locate the title text element.
[0087] Step 3072: Determine the main text element whose level corresponds to the main text in the second text element, and obtain the fourth position of the main text element.
[0088] Similarly, in this embodiment, it is necessary to determine the main text element corresponding to 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 association relationship 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.
[0090] After determining the third position of the title text element and the fourth position of the body text element, the association relationship between the title text element and the body text element can be determined, wherein the association relationship is used to characterize that the body text element is a subordinate content of the title text element. In one embodiment, a text association area can be divided according to the third positions of two adjacent title text elements, and it is determined that there is an association relationship between the body text element located in the text association area and the first title text element of the two adjacent title text elements.
[0091] Based on the above embodiment, in step 3073, determining the association relationship 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 includes:
[0092] Step 30731: Determine, among the title text elements, the target title text elements whose levels do not correspond to the target title levels.
[0093] In this embodiment, when determining the association relationship between the title text element and the body text element, it is first necessary to determine the target title text element whose level does not correspond to the target title level in the title text element. The target title level is a pre-specified title level. In this embodiment, since the first-level title has no corresponding body text, the target title level can be set to the first-level title. At this time, the target title text element whose level does not correspond to the first-level title is determined, that is, the target title text element whose level corresponds to other title levels such as the second-level title, the third-level title, etc. is determined.
[0094] Step 30732: Determine the traversal order of the target title text elements according to the third position of the target title text element.
[0095] After determining the target title text element, further obtain the third position of the target title text element, and determine the traversal order of the target title text element according to the third position, wherein the traversal order refers to the order of subsequent traversal of the target title text element. For example, the order in which the target title text element appears in the target courseware can be determined according to the third position of the target title text element, and the traversal order of the target title text element can be determined from the earliest to the latest in the order of appearance.
[0096] Step 30733: traverse the target title text elements in sequence according to the traversal order, and determine the text association area according to the third position of the currently traversed target title text element and the third position of the next target title text element located below the currently traversed target title text element.
[0097] After the traversal order is determined, the target title text elements can be traversed according to the traversal order. For the target title text element currently traversed, the third position of the target title text element currently traversed is obtained. At the same time, the next target title text element located below the target title text element currently traversed is determined, and the third position of the next target title text element is obtained. Afterwards, based on the third position of the target title text element currently traversed and the third position of the next target title text element, the area between the two target title text elements is determined, and the area is used as the text association area. In addition, it should be further explained that if the target title text element currently traversed 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, if Fig.10 As shown, 40 and 50 are the contents displayed on two adjacent pages, wherein the text association area between secondary title 1 and secondary title 2 includes area A and area B. At this time, the two-dimensional coordinates of area A and the two-dimensional coordinates of area B can be respectively obtained in the two pages to determine the text association area.
[0098] Step 30734: Determine the target body text element located in the text association area according to the fourth position of the body text element, and determine whether there is an association relationship between the target body text element and the currently traversed target title text element.
[0099] After determining the text association area, the target body text element located in the text association area can be determined according to the fourth position of the body text element, and it can be determined that there is an association relationship between the target body text element and the currently traversed target title text element, that is, the target body text element is a subordinate content of the currently traversed target title text element. After traversing all the target title text elements in sequence, the target body text element that has an association relationship with each target title text element can be determined.
[0100] In addition, for some special cases, for example, a certain secondary title of the target courseware includes a third-level title 1 and a third-level title 2, and a summary of the secondary title appears after the main text of the third-level title 2. If the above determination method is used, the summary content will be determined to be associated with the third-level title 2. Therefore, in order to avoid this situation, the target detection model can be used to identify the summary text element corresponding to the summary content in the target courseware, and the level of the summary text element is set to correspond to the summary content, so that when it is subsequently determined that there is a summary text element after the third-level title 2, it can be directly determined that the summary text element is associated with the secondary title.
[0101] The above is the specific process of determining the association relationship between the title text element and the body text element.
[0102] Step 3074: Determine the target structured information corresponding to the target courseware based on the first structured information and hierarchy of the title text element, the first structured information of the body text element, the association between the title text element and the body text element, and the first structured information of other elements.
[0103] After confirming the association 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 association relationship between the title text element and the body text element, and the first structured information of other elements.
[0104] Step 308: According to the target structured information, obtain the corresponding target processing template from a 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, the corresponding target processing template can be obtained from the preset processing template library according to the target structured information. The processing template library is a database including multiple processing templates, each processing template corresponds to a target structured information, and the processing template can be stored in the processing template library by the user in advance, or it can be automatically downloaded and updated from the server by the processing template library.
[0106] After obtaining the target processing template, the target processing template can be used to process the target courseware. Exemplarily, the target processing template includes colors, fonts, and font sizes corresponding to different title levels. When the target processing template is used to process the target courseware, the color, font, and font size corresponding to each title level can be obtained, and the corresponding title text elements and the body text elements associated with the title text elements can be modified and saved, thereby obtaining the processed target courseware and completing the beautification process of the target courseware.
[0107] As mentioned above, after acquiring the text structured information of the first text element, the embodiment of the present invention further assigns the level of the first text element to the second text element, and then further identifies the type of the element, distinguishes the title text element and the body text element in the second text element, and determines the association relationship between the body text element and the title text element, so as to subsequently determine the target structured information of the target courseware. Finally, the target courseware is processed according to the target processing template corresponding to the target structured information, thereby completing the beautification process of the target courseware. In the embodiment of the present invention, the level of the first text element and the second position are identified by the target detection model, which effectively avoids the problem of inaccurate division when dividing according to rules such as distance. In addition, the embodiment of the present invention determines the level of the title text element and the body text element associated with the title text element, so that in the subsequent beautification process, different attributes can be assigned to the title text elements and the body text elements of different levels in the target courseware, thereby making the page of the target courseware more beautiful. The embodiment of the present invention does not require the user to manually select a template when beautifying the target courseware. After manual selection, the user generally checks the beautification result and compares the beautification effects of different templates, which not only makes the selection difficult, but also wastes time, resulting in low beautification efficiency. The present invention can improve the beautification efficiency of the courseware by automatically beautifying the courseware, thereby solving the technical problem of low beautification efficiency of the courseware in the prior art.
[0108] like Fig.11 As shown, Fig.11 A structural diagram of a courseware automation processing device provided by 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 pictures 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, where each page includes at least one element.
[0111] The model analysis module 403 is used to input the image into a preset object detection model to obtain text structured 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 according to the first structured information and the text structured information.
[0113] The courseware automation processing module 405 is used to process the target courseware according to the target structured information.
[0114] Based on the above embodiment, 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 structural information of all elements corresponding to each page in the target courseware.
[0117] Based on the above embodiments, the target detection model is trained based on the Mask-RCNN model.
[0118] Based on the above embodiment, the first structured information includes the type of element, the content of the element and the first position of the element, and the text structured information includes the level of the first text element and the second position of the first text element.
[0119] The information acquisition module 404 includes:
[0120] The second text element determination submodule is used to determine the second text element in all elements according to the type of the first structured information.
[0121] The text element matching submodule is used to determine a 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.
[0122] The level assigning submodule is used to assign the level 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 according to the first structured information and the level of the second text element and the first structured information of other elements.
[0124] Based on the above embodiment, 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 use the first text element with the largest overlap as the target first text element corresponding to the second text element.
[0127] Based on the above embodiment, the hierarchy corresponds to the title level or to the body text.
[0128] The structured information determination submodule includes:
[0129] The third position determining unit is used to determine, in the second text element, a title text element whose level corresponds to the title level, and obtain a third position of the title text element.
[0130] The fourth position determining unit is used to determine the main text element whose level corresponds to the main text in the second text element, and obtain the fourth position of the main text element.
[0131] The association relationship determining unit is used to determine the association relationship 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.
[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 and hierarchy of the title text element, the first structured information of the body text element, the association between the title text element and the body text element, and the first structured information of other elements.
[0133] Based on the above embodiment, the association relationship determination unit includes:
[0134] The target element determination subunit is used to determine the target title text element whose level does not correspond to the target title level in the title text element.
[0135] The traversal order determination subunit is used to determine the traversal order of the target title text element according to the third position of the target title text element.
[0136] The associated area determination subunit is used to traverse the target title text elements in sequence according to the traversal order, and determine the text associated area according to the third position of the currently traversed target title text element and the third position of the next target title text element located below the currently traversed target title text element.
[0137] The associated text determination subunit is used to determine the target body text element located in the text association area according to the fourth position of the body text element, and determine whether there is an association relationship between the target body text element and the currently traversed target title text element.
[0138] Based on the above embodiment, 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 automation processing device provided in the embodiment of the present invention is included in the courseware automation processing equipment, and can be used to execute the courseware automation processing method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0140] It is worth noting that in the embodiment of the above-mentioned courseware automation processing 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.
[0141] This embodiment also provides a courseware automation processing device, such as Fig.12 As shown, the courseware automation processing device 50 includes a processor 500 and a memory 501;
[0142] The memory 501 is used to store the computer program 502 and transmit the computer program 502 to the processor 500;
[0143] The processor 500 is used to execute the steps in the above-mentioned embodiment of the courseware automation processing method according to the instructions in the computer program 502.
[0144] 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 automation processing device 50.
[0145] The courseware automation processing device 50 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The courseware automation processing 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.12 It is only an example of the courseware automation processing device 50 and does not constitute a limitation of the courseware automation processing 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 automation processing device 50 may also include input and 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 (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.
[0147] The memory 501 may be an internal storage unit of the courseware automation processing device 50, such as a hard disk or memory of the courseware automation processing device 50. The memory 501 may also be an external storage device of the courseware automation processing device 50, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the courseware automation processing device 50. Further, the memory 501 may also include both an internal storage unit and an external storage device 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 may also be used to temporarily store data that has been output or is to be output.
[0148] 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.
[0149] 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.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] The embodiment of the present invention further provides a storage medium containing computer executable instructions, which are used to execute a courseware automation processing method when executed by a computer processor. The method includes the following steps:
[0154] Get the target courseware and extract the pictures corresponding to each page of the target courseware;
[0155] Parsing the target courseware to determine first structural information of all elements corresponding to each page in the target courseware, each page including at least one element;
[0156] Input the image into a preset object detection model to obtain text structured information of the first text element corresponding to each page;
[0157] Determining target structured information corresponding to the target courseware according to the first structured information and the text structured information;
[0158] Process the target courseware according to the target structured information.
[0159] 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 automation processing method, characterized in that: include: Obtain target courseware, and extract pictures corresponding to each page of the target courseware; Parsing the target courseware to determine first structural information of all elements corresponding to each page in the target courseware, wherein each page includes at least one element; Inputting the image into a preset object detection model to obtain text structured information of the first text element corresponding to each of the pages; Determining target structured information corresponding to the target courseware according to the first structured information and the text structured information; The target courseware is processed according to the target structured information.
2. A courseware automation processing method according to claim 1, characterized in that: The step of parsing the target courseware to determine first structured information of all elements corresponding to each page in the target courseware includes: Converting the target courseware into target format data; The target format data is parsed to determine the first structural information of all elements corresponding to each page in the target courseware.
3. A courseware automation processing method according to claim 1, characterized in that: The target detection model is trained based on the Mask-RCNN model.
4. A courseware automation processing method according to claim 1, characterized in that: The first structural information includes the type of the element, the content of the element and the first position of the element, and the text structural information includes the level of the first text element and the second position of the first text element; The step of determining target structured information corresponding to the target courseware according to the first structured information and the text structured information includes: Determining a second text element from among all the elements according to the type of the first structured information; Determining, in the first text element, a target first text element corresponding to the second text element according to the first position of the second text element and the second position of the first text element; Assigning the level of the target first text element to the corresponding second text element; According to the first structural information of the second text element and the level, and the first structural information of other elements, structural information corresponding to the target courseware is determined.
5. A courseware automation processing method according to claim 4, characterized in that: The determining, in the first text element, a target first text element corresponding to the second text element according to the first position of the second text element and the second position of the first text element comprises: Calculating 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 largest overlap is used as the target first text element corresponding to the second text element.
6. A courseware automation processing method according to claim 4, characterized in that: The hierarchy corresponds to the heading level or to the body text; The step of determining the structured information corresponding to the target courseware according to the first structured information of the second text element and the level, and the first structured information of other elements, includes: Determine in the second text element that the level is a title text element corresponding to the title level, and obtain a third position of the title text element; Determine a body text element at the level corresponding to the body text in the second text element, and obtain a fourth position of the body text element; Determine the association relationship 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; The target structured information corresponding to the target courseware is determined based on the first structured information and hierarchy of the title text element, the first structured information of the body text element, the association between the title text element and the body text element, and the first structured information of other elements.
7. A courseware automation processing method according to claim 6, characterized in that: The determining the association relationship 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 includes: Determining, among the title text elements, a target title text element whose level does not correspond to the target title level; Determining a traversal order of the target title text elements according to the third position of the target title text element; Traversing the target title text elements in sequence according to the traversal order, and determining a text association area according to the third position of the target title text element currently traversed and the third position of the next target title text element located after the target title text element currently traversed; According to the fourth position of the body text element, a target body text element located in the text association area is determined, and it is determined that there is an association relationship between the target body text element and the currently traversed target title text element.
8. A courseware automation processing method according to claim 1, characterized in that: The processing of the target courseware according to the target structured information includes: According to 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, wherein the processing template library includes a plurality of processing templates.
9. A courseware automation processing device, characterized in that: include: A courseware acquisition module is used to acquire target courseware and extract pictures corresponding to each page of the target courseware; A courseware parsing module, used to parse the target courseware and determine first structured information of all elements corresponding to each page in the target courseware, wherein each page includes at least one element; A model analysis module, used for inputting the image into a preset object detection model to obtain text structured information of the first text element corresponding to each of the pages; An information acquisition module, used to determine target structured information corresponding to the target courseware according to the first structured information and the text structured information; The courseware automation processing module is used to process the target courseware according to the target structured information.
10. A courseware automation processing device, characterized in that: The courseware automation processing 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 automation processing method as described in any one of claims 1-8 according to instructions in the computer program.
11. A storage medium storing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to execute a courseware automation processing method as described in any one of claims 1-8.
Citation Information
Patent Citations
Slide processing method and device and electronic equipment
CN114254610A
Powerpoint conversion method and device, equipment and storage medium
CN115034177A
