PPT report generation method, system and device and storage medium
By performing image recognition and text analysis on the original PPT report, a matching mapping table for indicators and nodes is established, the problems of low efficiency and single style of PPT report generation in the existing technology are solved, and efficient and accurate report reconstruction is achieved.
Patent Information
- Application Number
- CN202411204971.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-12-24
AI Technical Summary
The existing PPT report generation method is inefficient in rapid generation and large-scale scenarios, and the generated report style is single, so it is impossible to effectively reuse the indicators and typesettings in formal reports.
By screenshotting the original PPT report, calling the visual model to identify the image content, the text model to identify the indicator diameter and indicator value, building a key-value dictionary, and establishing a matching mapping table based on the visual node and indicator diameter, replacing the original indicator value to generate Target report.
It improves the efficiency and accuracy of PPT report generation, reduces the probability of errors in filling indicator values, and is suitable for various types of PPT report generation.
Smart Images

Figure CN119180264A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, system, device and storage medium for generating a PPT report. Background Art
[0002] PPT reports usually refer to presentations made using relevant work software. This type of report is often used in meetings, lectures, teaching and other occasions to help speakers present information and ideas more intuitively and vividly. PPT reports generally contain multiple slides, each of which can contain text, pictures, charts, animations and other elements. By properly designing the layout and content, the audience can better understand and remember the core information of the report.
[0003] In the related art, in order to improve the processing efficiency of PPT reports, there are applications that automatically generate PPT reports. Existing PPT report generation methods are basically concentrated in two directions: 1. Filling based on manually written templates. This method requires a lot of time to write PPT templates, and it is impossible to quickly launch a new report, and it is not suitable for large-scale PPT report generation scenarios. 2. Generate PPT reports of several fixed themes by judging the rules of report data characteristics. The PPT reports generated by this method have a single style and simple content, and can only be used in informal scenarios.
[0004] In summary, the problems existing in related technologies need to be solved urgently. Summary of the invention
[0005] The purpose of this application is to solve one of the technical problems existing in the related art to at least a certain extent.
[0006] To this end, an object of an embodiment of the present application is to provide a method, system, device and storage medium for generating a PPT report.
[0007] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present application include:
[0008] On the one hand, an embodiment of the present application provides a method for generating a PPT report, the method comprising:
[0009] Obtaining an original PPT report, taking a screenshot of the original PPT report, and obtaining a report image;
[0010] Calling the visual big model to identify and extract the content in the report image to obtain first data; wherein the first data includes the type and content of each element in the report image;
[0011] Inputting the first data into a text macro model, and identifying each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber through the text macro model;
[0012] Using the indicator caliber as the value and the original indicator value corresponding to the indicator caliber as the key, a key-value pair dictionary is constructed;
[0013] Parsing the original PPT report to determine the visualization nodes contained in the original PPT report and the node content corresponding to each visualization node;
[0014] According to the key-value pair dictionary and the node content, the indicator caliber and the visualization node are matched to establish a matching mapping table; wherein the matching mapping table is used to record the corresponding relationship between the indicator caliber and the visualization node;
[0015] The target indicator value corresponding to each of the indicator calibers is obtained, and the original indicator value in the original PPT report is replaced according to the matching mapping table to obtain the target PPT report.
[0016] In addition, the method for generating a PPT report according to the above embodiment of the present application may also have the following additional technical features:
[0017] Further, in one embodiment of the present application, taking a screenshot of the original PPT report to obtain a report image includes:
[0018] The original PPT report is captured by using the headless mode of the LibreOffice tool to obtain a report image.
[0019] Further, in one embodiment of the present application, calling the visual big model to identify and extract the content in the report image to obtain the first data includes:
[0020] Acquire a first prompt word input by a user; the first prompt word is used to instruct the visual macro model to recognize the type and content of each element in the report image;
[0021] The first prompt word and the report image are input into the visual macromodel, and the content in the report image is identified and extracted by the visual macromodel to obtain the first data.
[0022] Further, in one embodiment of the present application, the step of inputting the first data into a large text model and identifying each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber through the large text model includes:
[0023] Obtaining a second prompt word input by a user; the second prompt word is used to instruct the text macro model to identify each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber;
[0024] The second prompt word and the first data are input into the text macro model, and the first data is identified and extracted through the text macro model to obtain each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber.
[0025] Further, in one embodiment of the present application, the file parsing of the original PPT report to determine the visualization nodes contained in the original PPT report and the node content corresponding to each visualization node includes:
[0026] Parsing the original PPT report to obtain a node tree corresponding to the original PPT report; wherein the node tree includes identification information, coordinate information and level information corresponding to each visualization node included in the original PPT report;
[0027] Traversing each of the visualization nodes in the node tree to determine the node content in the visualization node;
[0028] The node content in the visualization node is segmented, and an inverted index is constructed according to the segmentation result.
[0029] Further, in one embodiment of the present application, matching the indicator caliber and the visualization node according to the key-value pair dictionary and the node content to establish a matching mapping table includes:
[0030] Detecting the number of indicator calibers corresponding to the same original indicator value;
[0031] If the number of the indicator caliber is 1, a visualization node whose node content includes the original indicator value and a matching combination of the indicator caliber is established, and the matching combination is imported into the matching mapping table.
[0032] Further, in one embodiment of the present application, matching the indicator caliber and the visualization node according to the key-value pair dictionary and the node content to establish a matching mapping table also includes:
[0033] If there are multiple indicator calibers, determine all associated nodes whose node contents include the original indicator value from the visualization nodes;
[0034] For each of the indicator calibers, the Levenshtein distance between each of the visualization nodes and the indicator caliber, and the Euclidean distance between the visualization node and the associated node are calculated;
[0035] Determine a matching score corresponding to each visualization node according to the Levenshtein distance and the Euclidean distance corresponding to each visualization node;
[0036] A matching combination of the visualization node with the largest corresponding matching score and the indicator caliber is established, and the matching combination is imported into the matching mapping table.
[0037] On the other hand, an embodiment of the present application provides a system for generating a PPT report, the system comprising:
[0038] An acquisition unit, used for acquiring an original PPT report, taking a screenshot of the original PPT report, and obtaining a report image;
[0039] A first calling unit is used to call the visual big model to identify and extract the content in the report image to obtain first data; wherein the first data includes the type and content of each element in the report image;
[0040] A second calling unit is used to input the first data into a text large model, and identify each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber through the text large model;
[0041] A construction unit, used to construct a key-value pair dictionary using the indicator caliber as a value and the original indicator value corresponding to the indicator caliber as a key;
[0042] A parsing unit, used to parse the original PPT report to determine the visualization nodes contained in the original PPT report and the node content corresponding to each visualization node;
[0043] A matching unit, used to match the indicator caliber and the visualization node according to the key-value pair dictionary and the node content, and establish a matching mapping table; wherein the matching mapping table is used to record the corresponding relationship between the indicator caliber and the visualization node;
[0044] The processing unit is used to obtain the target indicator value corresponding to each of the indicator calibers, replace the original indicator value in the original PPT report according to the matching mapping table, and obtain the target PPT report.
[0045] On the other hand, an embodiment of the present application provides an electronic device, including:
[0046] at least one processor;
[0047] at least one memory for storing at least one program;
[0048] When the at least one program is executed by the at least one processor, the at least one processor implements the above-mentioned method for generating a PPT report.
[0049] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, which stores a program executable by a processor. When the program executable by the processor is executed by the processor, it is used to implement the above-mentioned method for generating a PPT report.
[0050] The advantages and benefits of the present application will be partially given in the following description, and partially become apparent from the following description, or be understood through the practice of the present application:
[0051] The method, system, device and storage medium for generating a PPT report disclosed in the embodiment of the present application, the method takes a screenshot of the original PPT report to obtain a report image, calls a visual large model to identify and extract the content in the report image, obtains the first data and inputs it into the text large model, identifies each indicator caliber and the corresponding original indicator value in the first data, and constructs a key-value pair dictionary; performs file parsing on the original PPT report, determines the visualization nodes contained in the original PPT report and the node content corresponding to each visualization node; matches the indicator caliber and the visualization node according to the key-value pair dictionary and the node content, and establishes a matching mapping table; obtains the target indicator value corresponding to each indicator caliber, replaces the original indicator value in the original PPT report according to the matching mapping table, and obtains the target PPT report. The method can establish a matching relationship between the visualization node and the indicator caliber based on the original PPT report, so as to facilitate the filling of the new target indicator value, rebuild and generate a new PPT report, and is conducive to improving the generation efficiency of the PPT report; and by matching the indicator caliber and the visualization node, the probability of the indicator value filling position error can be reduced, thereby improving the generation accuracy of the PPT report. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following introduction is made to the drawings of the embodiments of the present application or the related technical solutions in the prior art. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present application. For technical personnel in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0053] Figure 1 A schematic diagram of an implementation environment of a method for generating a PPT report provided in an embodiment of the present application;
[0054] Figure 2 A schematic diagram of a process for generating a PPT report provided in an embodiment of the present application;
[0055] Figure 3 A schematic diagram of a process for calling a large visual model to identify and extract content in a report image provided in an embodiment of the present application;
[0056] Figure 4 A schematic diagram of a process for using a large text model to identify various indicator calibers and corresponding original indicator values in first data provided in an embodiment of the present application;
[0057] Figure 5 A schematic diagram of a process for parsing an original PPT report provided in an embodiment of the present application;
[0058] Figure 6 A schematic diagram of a process for establishing a matching mapping table provided in an embodiment of the present application;
[0059] Figure 7 A schematic diagram of directly matching an indicator caliber with a visualization node provided in an embodiment of the present application;
[0060] Figure 8 A schematic diagram of a many-to-many relationship between an indicator caliber and a visualization node provided in an embodiment of the present application;
[0061] Fig. 9 A schematic diagram of the structure of a PPT report generation system provided in an embodiment of the present application;
[0062] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The present application is further described below in conjunction with the accompanying drawings and specific embodiments. The described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0064] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0066] 1) Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0067] 2) Machine Learning (ML) is a multi-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning (deep learning) usually includes artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0068] 3) Natural language processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. The natural language involved in this field is the language used by people in daily life, so it is also closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.
[0069] 4) Large models, usually referring to large-scale pre-trained models, have a large number of parameters (e.g., billions or more) and are trained on massive amounts of data to achieve broad adaptation and efficient processing of various tasks. These models learn complex patterns and features in data through multi-level neural network structures, and can capture deep correlations between different modal data such as language, images, and audio.
[0070] PPT reports usually refer to presentations made using relevant work software. This type of report is often used in meetings, lectures, teaching and other occasions to help speakers present information and ideas more intuitively and vividly. PPT reports generally contain multiple slides, each of which can contain text, pictures, charts, animations and other elements. By properly designing the layout and content, the audience can better understand and remember the core information of the report.
[0071] In the related art, in order to improve the processing efficiency of PPT reports, there are applications that automatically generate PPT reports. Existing PPT report generation methods are basically concentrated in two directions: 1. Filling based on manually written templates. This method requires a lot of time to write PPT templates, and it is impossible to quickly launch a new report, and it is not suitable for large-scale PPT report generation scenarios. 2. Generate PPT reports of several fixed themes by judging the rules of report data characteristics. The PPT reports generated by this method have a single style and simple content, and can only be used in informal scenarios.
[0072] For example, government and enterprise users need to write a large number of PPT reports every month, quarter, and year, and each page of these reports is carefully edited and laid out. Usually, such users hope to be able to generate a new PPT report based on a previous formal report, with the system recalculating the indicators in it and restoring the style and layout 100%. At present, the relevant technology only supports the recognition of content in PPT, but there is no mature method for recalculating and backfilling the indicators in it, facing a series of problems such as poor accuracy of position judgment, difficulty in handling ambiguity of equivalent values, and low restoration degree.
[0073] In view of this, a method for generating a PPT report is provided in an embodiment of the present application. The method takes a screenshot of the original PPT report to obtain a report image, calls a visual large model to identify and extract the content in the report image, obtains first data and inputs it into a text large model, identifies each indicator caliber in the first data and the corresponding original indicator value, and constructs a key-value pair dictionary; performs file parsing on the original PPT report to determine the visualization nodes contained in the original PPT report and the node content corresponding to each visualization node; matches the indicator caliber and the visualization node according to the key-value pair dictionary and the node content, and establishes a matching mapping table; obtains the target indicator value corresponding to each indicator caliber, and replaces the original indicator value in the original PPT report according to the matching mapping table to obtain a target PPT report. The method can establish a matching relationship between the visualization node and the indicator caliber based on the original PPT report, thereby facilitating the filling of new target indicator values, reconstructing and generating a new PPT report, and is conducive to improving the generation efficiency of the PPT report; and by matching the indicator caliber and the visualization node, the probability of the indicator value filling position error can be reduced, thereby improving the generation accuracy of the PPT report.
[0074] Please refer to Figure 1 , Figure 1 The schematic diagram of the implementation environment of a method for generating a PPT report provided in an embodiment of the present application is shown. In the implementation environment, the main hardware and software entities involved include a terminal device 110 and a backend server 120. The terminal device 110 and the backend server 120 are connected in communication.
[0075] Specifically, the PPT report generation method provided in the embodiment of the present application can be executed alone on the terminal device 110 side, or can be executed alone on the background server 120 side, or can be executed based on data interaction between the terminal device 110 and the background server 120.
[0076] Among them, the terminal device 110 of the above embodiment may include a mobile phone, a computer, a smart wearable device, a PDA device, an intelligent voice interaction device, a vehicle terminal, etc., but is not limited thereto.
[0077] The backend server 120 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0078] The terminal device 110 and the backend server 120 may establish a communication connection via a wireless network or a wired network. The wireless network or wired network uses standard communication technology and / or protocols, and the network may be set to the Internet or any other network, such as but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a private network or any combination of a virtual private network.
[0079] Of course, it is understandable that Figure 1 The implementation environment in the present application is only some optional application scenarios of the method for generating a PPT report provided in the embodiment of the present application, and the actual application is not fixed. Figure 1 The hardware and software environment shown.
[0080] Below, in combination with the introduction of the aforementioned implementation environment, a method for generating a PPT report provided in an embodiment of the present application is introduced and explained.
[0081] Please refer to Figure 2 , Figure 2 : is a schematic diagram of a method for generating a PPT report provided in an embodiment of the present application, and the method for generating a PPT report includes but is not limited to:
[0082] Step 210: Obtain the original PPT report, take a screenshot of the original PPT report, and obtain a report image;
[0083] Step 220: Call the visual macro model to identify and extract the content in the report image to obtain first data; wherein the first data includes the type and content of each element in the report image;
[0084] Step 230: input the first data into a text macro model, and identify each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber through the text macro model;
[0085] Step 240: construct a key-value pair dictionary using the indicator caliber as a value and the original indicator value corresponding to the indicator caliber as a key;
[0086] Step 250: parsing the original PPT report to determine the visualization nodes contained in the original PPT report and the node content corresponding to each visualization node;
[0087] Step 260: Match the indicator caliber and the visualization node according to the key-value pair dictionary and the node content, and establish a matching mapping table; wherein the matching mapping table is used to record the corresponding relationship between the indicator caliber and the visualization node;
[0088] Step 270: Obtain the target indicator value corresponding to each of the indicator calibers, replace the original indicator value in the original PPT report according to the matching mapping table, and obtain the target PPT report.
[0089] In an embodiment of the present application, a method for generating a PPT report is provided. The method can establish a matching relationship between visualization nodes and indicator calibers based on the original PPT report, thereby facilitating the filling of new target indicator values and rebuilding and generating a new PPT report, which is beneficial to improving the generation efficiency of the PPT report; and, by matching the indicator caliber and the visualization node, the probability of incorrect indicator value filling position can be reduced, thereby improving the generation accuracy of the PPT report.
[0090] Specifically, in the embodiment of the present application, when performing a PPT report generation operation, the original PPT report used as a basic report template can be first obtained. Here, the original PPT report can be used to generate a new target PPT report. The target PPT report can replace the data content in the original PPT report while retaining the typesetting format of the original PPT report, thereby greatly improving the generation efficiency of the PPT report. Moreover, this implementation method does not require relevant personnel to manually arrange the template, nor is it limited to certain specific typesetting formats, and is applicable to various types of PPT reports.
[0091] In the embodiment of the present application, the content of the original PPT report can cover various industries, and there is no restriction on the specific scenario. After obtaining the original PPT report, it can be screenshotted to obtain the corresponding image, which is recorded as a report image in the embodiment of the present application. It can be understood that for a PPT report, the images included therein can be one or more images. In the embodiment of the present application, there is no restriction on the specific number of report images. When taking a screenshot of the original PPT report, it can be implemented according to the operating system used (such as Windows, macOS, etc.). For example, you can choose a built-in screenshot tool or a third-party application to take a screenshot to obtain a report image.
[0092] After obtaining the report image, the visual large model can be called to identify and extract the content in the report image, and the obtained data is recorded as the first data. Specifically, Visual Large Models (VLMs) refers to a type of computer vision model based on deep learning technology. They are trained with large-scale data sets and can effectively identify and understand complex content in images or videos. Such models have a wide range of applications in many fields, including but not limited to target detection, semantic segmentation, image classification, text recognition, etc. In the embodiments of the present application, the visual large model can be built using convolutional neural networks (CNNs), such as the AlexNet model, the VGG model, etc. Of course, the specific model algorithm and architecture can be selected according to actual needs, and this application does not limit this.
[0093] In the embodiment of the present application, the content in the image can be identified and extracted by calling the visual big model, and then the first data can be constructed. The first data here may include the type and content of each element in the report image. Exemplarily, in the embodiment of the present application, the first data can be output in the format of [{"type":"text","content":"..."}]. For example, a set of first data can be expressed as:
[0094] [{"type":"text","content":"Main revenue completion rate 79%"},{"type":"table","title":"Budget completion status","content":{"header":["Category","Completion status (100 million yuan)","Increase rate","Completion rate"],"rows":[["Existing revenue","79","79%"],["Innovative revenue","69","89%"]]}}].
[0095] In the embodiment of the present application, after obtaining the first data, the first data can be further input into the text big model, and the index value corresponding to each index caliber and the index caliber in the first data can be identified by the text big model, and the index value identified in the first data is recorded as the original index value. Similarly, in the embodiment of the present application, the text big model refers to a large-scale machine learning model that is pre-trained and can handle natural language processing (NLP) tasks. These models have learned to understand and generate human language capabilities by pre-training on a large amount of text data. In the embodiment of the present application, the text big model can adopt a Transformer-based model, such as BERT (Bidirectional Encoder Representations from Transformers), GPT (Generative Pre-trained Transformer), or Sequence-to-Sequence Models (sequence to sequence model). Of course, the specific model algorithm and architecture can be selected according to actual needs, and this application is not limited to this.
[0096] In an embodiment of the present application, by inputting the first data into the text big model, the text big model can be used to identify the various indicator calibers and the corresponding original indicator values in the first data. In an embodiment of the present application, the indicator caliber can be represented by spec, and the indicator value can be represented by value. For example, <main business income completed 8.121 billion yuan> can be output [{"spec":"main business income completed","value":"8.121 billion yuan"}]. For example, taking the first data mentioned above as an example, its corresponding indicator caliber and the corresponding original indicator value can be expressed as:
[0097] [{"spec":"Completion rate of main operating income","value":"79%"},{"spec":"Completion amount of existing income budget (100 million yuan)","value":"79"},{"spec":"Increase in existing income","value":"79%"},{"spec":"Completion amount of innovative income budget (100 million yuan)","value":"69"},{"spec":"Increase in innovative income","value":"89%"}].
[0098] In the embodiment of the present application, after obtaining each indicator caliber and the original indicator value corresponding to the indicator caliber, a key-value pair dictionary can be constructed with the indicator caliber as the value and the original indicator value corresponding to the indicator caliber as the key. The key-value pair dictionary can be expressed as D<value,spec[]> Taking the first data mentioned above as an example, its corresponding key-value pair dictionary can be expressed as:
[0099] {"69":["Completion of innovative income budget (100 million yuan)"], "79":["Completion of existing income budget (100 million yuan)"], "8.121 billion yuan":["Completion of main business income"], "7.62%":["Increase in main business income"], "79%":["Completion rate of main business income", "Increase in existing income"], "89%":["Increase in innovative income"]}.
[0100] It can be seen that in the above key-value pair dictionary, the value "79%" is associated with two indicator calibers, which means that the values of both indicator calibers are "79%".
[0101] In the embodiment of the present application, for a PPT type file, it can be regarded as a node tree composed of a large number of visual nodes in a one-to-many relationship. In the embodiment of the present application, the original PPT report can be parsed using a class library POI or the like to determine the visual nodes contained therein and the node content corresponding to each visual node. The obtained data can be represented by referring to the following method:
[0102] [{"view_id": "0-1", "point": [431, 182], "content": "content", "children": […]}]
[0103] Among them, view_id is the identification information corresponding to the visualization node, point is the coordinate information of the visualization node in the PPT, and children is the child node of the visualization node, which can reflect the hierarchical information between the visualization nodes.
[0104] In the embodiment of the present application, the indicator caliber and the visualization node can be matched according to the key-value pair dictionary and the node content to establish a matching mapping table. The matching mapping table here can be used to record the corresponding relationship between the indicator caliber and the visualization node, that is, which visualization node is used to display the data corresponding to which indicator caliber.
[0105] It is understandable that after the matching relationship is established, if the indicator value changes later and a new PPT report needs to be written, the matching mapping table in the embodiment of the present application can be used to fill the new indicator value into the original PPT report, thereby realizing the generation of a new target PPT report. Specifically, in the embodiment of the present application, if a new PPT report needs to be generated, the indicator value corresponding to each indicator caliber can be obtained, recorded as the target indicator value, and then according to the matching mapping table, the target indicator value is filled into the visualization node that matches the corresponding indicator caliber, and the original indicator value in the original PPT report is replaced to obtain the target PPT report.
[0106] Specifically, in some embodiments, taking a screenshot of the original PPT report to obtain a report image includes:
[0107] The original PPT report is captured by using the headless mode of the LibreOffice tool to obtain a report image.
[0108] In the embodiment of the present application, the LibreOffice tool can be used to take a screenshot of the original PPT report. LibreOffice supports headless mode, which means that LibreOffice can be run without a graphical interface. This can be run in a server environment or used in an automated script.
[0109] Specifically, in some embodiments, referring to Figure 3 , the calling of the visual big model to identify and extract the content in the report image to obtain the first data includes:
[0110] Acquire a first prompt word input by a user; the first prompt word is used to instruct the visual macro model to recognize the type and content of each element in the report image;
[0111] The first prompt word and the report image are input into the visual macromodel, and the content in the report image is identified and extracted by the visual macromodel to obtain the first data.
[0112] In the embodiment of the present application, when using the visual big model, the user can input relevant instruction information, which is recorded as the first prompt word in the embodiment of the present application. The first prompt word can be used to instruct the visual big model to identify the type and content of each element in the report image. Exemplarily, in some embodiments, the first prompt word can be "This is a screenshot of a page in the PPT report. Please identify the type and content of the elements therein and output it in the format of [{"type":"text","content":"..."}]". Of course, in the embodiment of the present application, there is no limitation on the specific content of the first prompt word, and it can be flexibly set according to actual needs.
[0113] In the embodiment of the present application, by inputting the first prompt word and the report image into the visual big model, the visual big model can be helped to better understand the task to be processed, thereby realizing the recognition and extraction of the content in the report image to obtain the first data.
[0114] Specifically, in some embodiments, referring to Figure 4 , the step of inputting the first data into a large text model, and identifying each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber through the large text model, includes:
[0115] Obtaining a second prompt word input by a user; the second prompt word is used to instruct the text macro model to identify each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber;
[0116] The second prompt word and the first data are input into the text macro model, and the first data is identified and extracted through the text macro model to obtain each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber.
[0117] In the embodiment of the present application, when using the text macro model, the user can also input relevant instruction information, which is recorded as the second prompt word in the embodiment of the present application. The second prompt word can be used to instruct the text macro model to identify the various indicator calibers in the first data and the original indicator values corresponding to the indicator calibers. Exemplarily, in some embodiments, the second prompt word can be "This is the content identified from the PPT. Please identify the indicator caliber and its corresponding value from it. For example, <Main business income completed 8.121 billion yuan>, it should output [{"spec":"Main business income completed", "value":"8.121 billion yuan"}]". Of course, in the embodiment of the present application, similarly, there is no restriction on the specific content of the second prompt word, which can be flexibly set according to actual needs.
[0118] In an embodiment of the present application, by inputting the second prompt word and the report image into the text big model, the text big model can be helped to better understand the task to be processed, thereby realizing the recognition and extraction of each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber.
[0119] In some embodiments, reference Figure 5 , the file parsing of the original PPT report to determine the visualization nodes contained in the original PPT report and the node content corresponding to each visualization node includes:
[0120] The original PPT report is parsed to obtain a node tree corresponding to the original PPT report; wherein the node tree includes identification information, coordinate information and level information corresponding to each visualization node included in the original PPT report;
[0121] Traversing each of the visualization nodes in the node tree to determine the node content in the visualization node;
[0122] The node content in the visualization node is segmented, and an inverted index is constructed according to the segmentation result.
[0123] In the embodiment of the present application, when parsing the original PPT report, the original PPT file can be first parsed into a node tree using the class library POI, and corresponding identification information can be generated for each visualization node. The identification information can be composed of a hierarchy and a sibling node sequence. When a new target PPT report is subsequently generated, data can be backfilled according to the identification information. In the embodiment of the present application, each visualization node in the node tree can also be traversed to determine the node content in the visualization node. Then, the node content in the visualization node is segmented, and an inverted index I is constructed based on the segmentation result.<text,node[]> For example, in the embodiment of the present application, the inverted index I can be expressed as:
[0124] {"79": [{"view_id":"1-2","points":[…]}],"Main business income": [{"view_id":"0-1","points":[…]}],"Completion rate": [{"view_id":"0-2","points":[…]}],"79%": [{"view_id":"0-3","points":[…]},{"view_id":"1-3","points":[…]}]}.
[0125] In some embodiments, reference Figure 6 , matching the indicator caliber and the visualization node according to the key-value pair dictionary and the node content, and establishing a matching mapping table, including:
[0126] Detecting the number of indicator calibers corresponding to the same original indicator value;
[0127] If the number of the indicator caliber is 1, a visualization node whose node content includes the original indicator value and a matching combination of the indicator caliber is established, and the matching combination is imported into the matching mapping table.
[0128] In the embodiment of the present application, when establishing the matching mapping table, for each original indicator value, there may be a problem of corresponding to one or more indicator calibers. Therefore, the number of indicator calibers corresponding to the same original indicator value can be detected. If the number of indicator calibers is 1, the key-value pair dictionary D<value,spec[]> and inverted index I<text,node[]> There is no key conflict in the data, that is, the indicator value recognized by the visual model is unique, and the node content parsed by the POI is also unique. Therefore, the indicator value can be used as a bridge to match the indicator caliber spec recognized by the semantic model with the visualization node. Figure 7 , Figure 7A schematic diagram of directly matching indicator calibers with visualization nodes in an embodiment of the present application is shown. It can be seen that when the original indicator value corresponds to an indicator caliber, a matching combination between the indicator caliber and the visualization node whose node content includes the original indicator value can be directly established and imported into the matching mapping table.
[0129] In contrast, if there are multiple indicator calibers, all nodes whose node contents include the original indicator value can be determined from the visualization nodes and recorded as associated nodes. Then, for each indicator caliber, the Levenshtein distance between each visualization node and the indicator caliber, as well as the Euclidean distance between the visualization node and the associated node can be calculated; based on the Levenshtein distance and Euclidean distance corresponding to each visualization node, the matching score corresponding to the visualization node can be determined. In the embodiment of the present application, a matching combination of the corresponding visualization node and the indicator caliber with the largest matching score can be established, and the matching combination can be imported into the matching mapping table.
[0130] It is understandable that in many PPT reports, there will be situations where "the values of multiple different indicators are the same" and "the contents of multiple visualization nodes are the same", that is, there is a many-to-many relationship between the indicator caliber and the visualization node. Figure 8 , Figure 8 A schematic diagram showing a many-to-many relationship between indicator caliber and visualization node in the embodiment of the present application is shown. In the embodiment of the present application, the key-value pair dictionary D<value,spec[]> and inverted index I<text,node[]> Matching disambiguation is mainly divided into the following operations:
[0131] Operation 1: Select D<value,spec[]> A certain indicator value corresponds to multiple indicator calibers spec[n];
[0132] Operation 2: Use value as key, from I<text,node[]> Get the relevant visualization node list node[m];
[0133] Operation 3: Perform permutations and combinations P(spec[n]) on spec[n], and traverse each permutation and combination;
[0134] Operation 4: traverse each indicator caliber spec in the permutation combination;
[0135] Operation 5: traverse the unmatched visualization nodes in the visualization node list;
[0136] Operation 6: traverse all visualization nodes ENode on the current page and calculate: 1. the Levenshtein distance with the indicator caliber spec in operation 4; 2. the Euclidean distance with the visualization node Node in operation 5. Substitute the following formula to obtain the matching score s between the indicator caliber and the visualization node (abbreviated as indicator-node):
[0137]
[0138] Among them, K is the text matching threshold, the calculation function L is the Levenshtein distance, and E is the Euclidean distance;
[0139] Operation 7: Among all the matching scores obtained in Operation 6, the maximum value is selected as the "(local best) indicator-node" matching score Smax, and the matching combination is recorded in the "(local best) matching mapping table" at the same time;
[0140] Operation 8: sum all (local best) matching scores Smax obtained in operation 7 to obtain the comprehensive matching score SSmax of the current caliber permutation and combination, and also obtain the "(local best) matching mapping table" corresponding to the permutation and combination;
[0141] Operation 9: After traversing all caliber permutations and combinations, select the "(local best) matching mapping table" with the highest comprehensive matching score, and add all its matching items to the "(global best) matching mapping table";
[0142] Operation 10: Repeat operations 1 to 9 to obtain the eliminated metric-node mapping table GlobalBestMatch<spec,node> .
[0143] Reference Fig. 9 In an embodiment of the present application, a system for generating a PPT report is also provided, comprising:
[0144] The acquisition unit 910 is used to acquire the original PPT report, take a screenshot of the original PPT report, and obtain a report image;
[0145] The first calling unit 920 is used to call the visual big model to identify and extract the content in the report image to obtain first data; wherein the first data includes the type and content of each element in the report image;
[0146] The second calling unit 930 is used to input the first data into the text big model, and identify each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber through the text big model;
[0147] A construction unit 940 is used to construct a key-value pair dictionary using the indicator caliber as a value and the original indicator value corresponding to the indicator caliber as a key;
[0148] The parsing unit 950 is used to parse the original PPT report to determine the visualization nodes contained in the original PPT report and the node content corresponding to each visualization node;
[0149] A matching unit 960, configured to match the indicator caliber and the visualization node according to the key-value pair dictionary and the node content, and establish a matching mapping table; wherein the matching mapping table is used to record the corresponding relationship between the indicator caliber and the visualization node;
[0150] The processing unit 970 is used to obtain the target indicator value corresponding to each of the indicator calibers, replace the original indicator value in the original PPT report according to the matching mapping table, and obtain the target PPT report.
[0151] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0152] Reference Fig.10 , an embodiment of the present application provides an electronic device, including:
[0153] at least one processor 1010;
[0154] At least one memory 1020, used to store at least one program;
[0155] When at least one program is executed by at least one processor 1010, at least one processor 1010 implements the above-mentioned PPT report generation method or text generation method.
[0156] Similarly, the contents of the above method embodiments are all applicable to the electronic device embodiments. The functions specifically implemented by the electronic device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0157] The embodiment of the present application also provides a computer-readable storage medium, which stores a program executable by the processor 1010. When the program executable by the processor 1010 is executed by the processor 1010, it is used to execute the above-mentioned PPT report generation method or text generation method.
[0158] Similarly, the contents of the above method embodiments are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0159] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the application is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part described as a larger operation is performed independently.
[0160] In addition, although the present application is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present application. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional techniques of the engineer. Therefore, those skilled in the art can implement the present application set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is determined by the full scope of the attached claims and their equivalents.
[0161] If the function 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 application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. 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., which can store program code.
[0162] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0163] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0164] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0165] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0166] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.
[0167] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Technical personnel familiar with the field can make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.
Claims
1. A method for generating a PPT report, characterized in that: The method comprises: Obtaining an original PPT report, taking a screenshot of the original PPT report, and obtaining a report image; Calling the visual big model to identify and extract the content in the report image to obtain first data; wherein the first data includes the type and content of each element in the report image; Inputting the first data into a text macro model, and identifying each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber through the text macro model; Using the indicator caliber as the value and the original indicator value corresponding to the indicator caliber as the key, a key-value pair dictionary is constructed; Parsing the original PPT report to determine the visualization nodes contained in the original PPT report and the node content corresponding to each visualization node; According to the key-value pair dictionary and the node content, the indicator caliber and the visualization node are matched to establish a matching mapping table; wherein the matching mapping table is used to record the corresponding relationship between the indicator caliber and the visualization node; The target indicator value corresponding to each of the indicator calibers is obtained, and the original indicator value in the original PPT report is replaced according to the matching mapping table to obtain the target PPT report.
2. A method for generating a PPT report according to claim 1, characterized in that: The method of taking a screenshot of the original PPT report to obtain a report image includes: The original PPT report is captured by using the headless mode of the LibreOffice tool to obtain a report image.
3. The method for generating a PPT report according to claim 1, characterized in that: The calling of the visual big model to identify and extract the content in the report image to obtain the first data includes: Acquire a first prompt word input by a user; the first prompt word is used to instruct the visual macro model to recognize the type and content of each element in the report image; The first prompt word and the report image are input into the visual macromodel, and the content in the report image is identified and extracted by the visual macromodel to obtain the first data.
4. The method for generating a PPT report according to claim 1, characterized in that: The step of inputting the first data into a large text model and identifying each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber through the large text model includes: Obtaining a second prompt word input by a user; the second prompt word is used to instruct the text macro model to identify each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber; The second prompt word and the first data are input into the text macro model, and the first data is identified and extracted through the text macro model to obtain each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber.
5. The method for generating a PPT report according to claim 1, characterized in that: The performing file parsing on the original PPT report to determine the visualization nodes contained in the original PPT report and the node content corresponding to each visualization node includes: Parsing the original PPT report to obtain a node tree corresponding to the original PPT report; wherein the node tree includes identification information, coordinate information and hierarchical information corresponding to each visualization node included in the original PPT report; Traversing each of the visualization nodes in the node tree to determine the node content in the visualization node; The node content in the visualization node is segmented, and an inverted index is constructed according to the segmentation result.
6. A method for generating a PPT report according to any one of claims 1 to 5, characterized in that: The step of matching the indicator caliber and the visualization node according to the key-value pair dictionary and the node content to establish a matching mapping table includes: Detecting the number of indicator calibers corresponding to the same original indicator value; If the number of the indicator caliber is 1, a visualization node whose node content includes the original indicator value and a matching combination of the indicator caliber is established, and the matching combination is imported into the matching mapping table.
7. A method for generating a PPT report according to claim 6, characterized in that: The matching of the indicator caliber and the visualization node according to the key-value pair dictionary and the node content to establish a matching mapping table also includes: If there are multiple indicator calibers, determine all associated nodes whose node contents include the original indicator value from the visualization nodes; For each of the indicator calibers, the Levenshtein distance between each of the visualization nodes and the indicator caliber, and the Euclidean distance between the visualization node and the associated node are calculated; Determine a matching score corresponding to each visualization node according to the Levenshtein distance and the Euclidean distance corresponding to each visualization node; A matching combination of the visualization node with the largest corresponding matching score and the indicator caliber is established, and the matching combination is imported into the matching mapping table.
8. A system for generating a PPT report, characterized in that: The system comprises: An acquisition unit, used for acquiring an original PPT report, taking a screenshot of the original PPT report, and obtaining a report image; A first calling unit is used to call the visual big model to identify and extract the content in the report image to obtain first data; wherein the first data includes the type and content of each element in the report image; A second calling unit is used to input the first data into a text big model, and identify each indicator caliber in the first data and the original indicator value corresponding to the indicator caliber through the text big model; A construction unit, used to construct a key-value pair dictionary using the indicator caliber as a value and the original indicator value corresponding to the indicator caliber as a key; A parsing unit, used to parse the original PPT report to determine the visualization nodes contained in the original PPT report and the node content corresponding to each visualization node; A matching unit, used to match the indicator caliber and the visualization node according to the key-value pair dictionary and the node content, and establish a matching mapping table; wherein the matching mapping table is used to record the corresponding relationship between the indicator caliber and the visualization node; The processing unit is used to obtain the target indicator value corresponding to each of the indicator calibers, replace the original indicator value in the original PPT report according to the matching mapping table, and obtain the target PPT report.
9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements a method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement a method according to any one of claims 1 to 7 when executed by the processor.
Citation Information
Cited By
Two-chemical fusion analysis report generation method and device, electronic equipment and storage medium
CN119476220A
