用大模型实现PPT可视化几种思路

https://zhuanlan.zhihu.com/p/700685802

背景

前面一篇文章已经介绍了如何根据用户输入,用大模型实现内容检索、分析、脑图可视化的链路。然而往往投研团队需要针对重要新闻做组内分析解读,需要用ppt的方式来展现;那么优美可能让大模型直接针对前面文章生成的内容生成ppt呢。
这部分介绍如何基于用户输入生成PPT,重点介绍PPT的生成几种思路。对于如何根据用户输入的信息做信息的整理组织,然后把整理组织信息作排版,生成合适的PPt呈现不是重点介绍对象。

PPT几种思路

pptx API+code interpreter

1.对用户输入信息做理解整理
2.大模型直接根据用户信息生成代码
3.code interpreter执行生成代码生成PPT

这种解法的问题:

1.生成的PPT相对固定
2.不容易生成图文搭配ppt
3.比较考验大模型长文本理解能力(模型能力不够容易生成内容和用户输入不相关)

下面以GLM4网页版应用为例说明:

输入:

📰 新闻主题: 浪潮数字商业精彩亮相2024年第四届新加坡亚洲科技展
📰 新闻详情: 作为快消品行业数智化转型领先服务商,浪潮数字商业受邀参展,展示了其在快消品行业的技术实力和解决方案。
📰 新闻解读: 此次亮相凸显了浪潮数字商业在国际舞台上的影响力,也体现了中国科技企业在东南亚市场的积极拓展。
📰 新闻所属类别: 科技
📎 新闻 URL: 浪潮数字商业精彩亮相
📰 新闻主题: 研究人员在人体和犬类的睾丸组织中发现微塑料
📰 新闻详情: 研究人员在人体和犬类的睾丸组织中发现了微塑料,这一发现引发了关于微塑料对生殖健康影响的担忧。
📰 新闻解读: 此项研究结果可能对人类健康产生重大影响,突显了微塑料污染问题的严重性。
📰 新闻所属类别: 健康
📎 新闻 URL: 微塑料研究发现
📰 新闻主题: 哈勃望远镜探索处女座星系团的棒状螺旋星系NGC 4731
📰 新闻详情: 哈勃望远镜探索了处女座星系团的棒状螺旋星系NGC 4731,展示了其详细的颜色和结构。
📰 新闻解读: 这项研究有助于科学家更好地理解星系的形成和演化过程。
📰 新闻所属类别: 天文
📎 新闻 URL: 哈勃望远镜探索
📰 新闻主题: 20245月科技事件日历一览表
📰 新闻详情: 5月份,包括嫦娥六号发射、CORSAIR ONE i500 紧凑型高性能 PC 发布、联发科天玑开发者大会等重要科技事件。
📰 新闻解读: 这些科技事件展示了中国在航天、计算机硬件和移动通信技术领域的快速发展。
📰 新闻所属类别: 科技
📎 新闻 URL: 5月科技事件日历
📰 新闻主题: 20245月科技界大事件盘点
📰 新闻详情: 5月份,科技圈发生了一系列重磅新闻和热点事件。
📰 新闻解读: 这些事件反映了科技领域的发展趋势和市场动态。
📰 新闻所属类别: 科技
📎 新闻 URL: 5月科技大事件
📰 新闻主题: 中国煤科亮相2024国际零碳城市乡村与零碳建筑大会暨技术设备博览会
📰 新闻详情: 中国煤科携所属重庆设计院、北京华宇、西...等亮相,展示了其在零碳城市建设和零碳建筑方面的技术和成果。
📰 新闻解读: 中国煤科的参与体现了中国在绿色能源和可持续发展方面的努力和成就。
📰 新闻所属类别: 科技
📎 新闻 URL: 中国煤科亮相
📰 新闻主题: 20245月科技事件预告
📰 新闻详情: 包括嫦娥六号发射、苹果“放飞吧”特别活动、2024谷歌 I/O 开发者大会等重要活动。
📰 新闻解读: 这些活动预告预示着未来科技发展的方向和趋势。
📰 新闻所属类别: 科技
📎 新闻 URL: 5月科技事件预告
📰 新闻主题: 东南亚地区的科技互联网领域事件回顾
📰 新闻详情: 动点科技回顾了上周东南亚科技互联网领域的重要事件。
📰 新闻解读: 通过回顾,可以了解东南亚地区科技互联网的发展动态和趋势。
📰 新闻所属类别: 科技
📎 新闻 URL: 东南亚科技回顾
📰 新闻主题: 2024中国华夏家博会(北京)
📰 新闻详情: 北京国家会议中心将举办2024中国华夏家博会(北京)、第22届北京国际热处理展览会、第十一届中国指挥控制大会暨第九届...等多个科技展会。
📰 新闻解读: 这些展会的举办将进一步推动中国科技产业的发展和交流。
📰 新闻所属类别: 科技
📎 新闻 URL: 2024中国华夏家博会
以上是本周国际国内科技新闻的前10条摘要,涵盖了科技、健康、天文等多个领域,反映了当前科技发展的最新动态和趋势。
把上面信息转成ppt格式

生成代码:

from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.enum.text import PP_ALIGN
from pptx.dml.color import RGBColor

# Create a presentation object
prs = Presentation()

# Function to add a slide with title and content
def add_slide(title, detail, interpretation, category, url):
    slide_layout = prs.slide_layouts[1]  # using slide layout 1 for title and content
    slide = prs.slides.add_slide(slide_layout)
    title_placeholder = slide.shapes.title
    content_placeholder = slide.placeholders[1]

    # Set title
    title_placeholder.text = title
    for paragraph in title_placeholder.text_frame.paragraphs:
        for run in paragraph.runs:
            run.font.size = Pt(24)
            run.font.bold = True

    # Set content
    content = f"详情: {detail}\n解读: {interpretation}\n类别: {category}\n新闻链接: {url}"
    content_placeholder.text = content
    for paragraph in content_placeholder.text_frame.paragraphs:
        paragraph.alignment = PP_ALIGN.LEFT
        for run in paragraph.runs:
            run.font.size = Pt(18)

# Add slides for each news item
add_slide("浪潮数字商业精彩亮相2024年第四届新加坡亚洲科技展",
          "作为快消品行业数智化转型领先服务商,浪潮数字商业受邀参展,展示了其在快消品行业的技术实力和解决方案。",
          "此次亮相凸显了浪潮数字商业在国际舞台上的影响力,也体现了中国科技企业在东南亚市场的积极拓展。",
          "科技", "浪潮数字商业精彩亮相")

add_slide("研究人员在人体和犬类的睾丸组织中发现微塑料",
          "研究人员在人体和犬类的睾丸组织中发现了微塑料,这一发现引发了关于微塑料对生殖健康影响的担忧。",
          "此项研究结果可能对人类健康产生重大影响,突显了微塑料污染问题的严重性。",
          "健康", "微塑料研究发现")

add_slide("哈勃望远镜探索处女座星系团的棒状螺旋星系NGC 4731",
          "哈勃望远镜探索了处女座星系团的棒状螺旋星系NGC 4731,展示了其详细的颜色和结构。",
          "这项研究有助于科学家更好地理解星系的形成和演化过程。",
          "天文", "哈勃望远镜探索")

add_slide("2024年5月科技事件日历一览表",
          "5月份,包括嫦娥六号发射、CORSAIR ONE i500 紧凑型高性能 PC 发布、联发科天玑开发者大会等重要科技事件。",
          "这些科技事件展示了中国在航天、计算机硬件和移动通信技术领域的快速发展。",
          "科技", "5月科技事件日历")

add_slide("2024年5月科技界大事件盘点",
          "5月份,科技圈发生了一系列重磅新闻和热点事件。",
          "这些事件反映了科技领域的发展趋势和市场动态。",
          "科技", "5月科技大事件")

add_slide("中国煤科亮相2024国际零碳城市乡村与零碳建筑大会暨技术设备博览会",
          "中国煤科携所属重庆设计院、北京华宇、西...等亮相,展示了其在零碳城市建设和零碳建筑方面的技术和成果。",
          "中国煤科的参与体现了中国在绿色能源和可持续发展方面的努力和成就。",
          "科技", "中国煤科亮相")

add_slide("2024年5月科技事件预告",
          "包括嫦娥六号发射、苹果“放飞吧”特别活动、2024谷歌 I/O 开发者大会等重要活动。",
          "这些活动预告预示着未来科技发展的方向和趋势。",
          "科技", "5月科技事件预告")

add_slide("东南亚地区的科技互联网领域事件回顾",
          "动点科技回顾了上周东南亚科技互联网领域的重要事件。",
          "通过回顾,可以了解东南亚地区科技互联网的发展动态和趋势。",
          "科技", "东南亚科技回顾")

add_slide("2024中国华夏家博会(北京)",
          "北京国家会议中心将举办2024中国华夏家博会(北京)、第22届北京国际热处理展览会、第十一届中国指挥控制大会暨第九届...等多个科技展会。",
          "这些展会的举办将进一步推动中国科技产业的发展和交流。",
          "科技", "2024中国华夏家博会")

# Save the presentation
pptx_file = "/mnt/data/Weekly_Technology_News_Summary.pptx"
prs.save(pptx_file)

pptx_file

code interpreter执行生成代码生成PPT:
image.png

生成Latex

1.把用户输入做简单格式整理
2.对整理好的格式数据生成Latex
3.对生成的Latex脚本编译生成ppt

问题

1.如果只是用大模型做排版,不容易为ppt配图
2.生成模版比较单一

以GPT4o为例说明:

1.根据用户输入对数据做格式整理
image.png
2.利用gpt4o生成排版内容生成Latex脚本,prompt:“把上面slide格式转成latex ppt方式”

\documentclass{beamer}

\title{Weekly International and Domestic Tech News Summary}
\subtitle{Covering Technology, Health, Astronomy, and More}
\author{}
\date{}

\begin{document}

% Title Slide
\begin{frame}
    \titlepage
\end{frame}

% Slide 2
\begin{frame}
    \frametitle{Inspur Digital Business Shines at 2024 Fourth Singapore Asia Tech Show}

    \begin{itemize}
        \item \textbf{News Details:}\\
        As a leading service provider for the digital transformation of the fast-moving consumer goods industry, Inspur Digital Business was invited to participate, demonstrating its technological capabilities and solutions in the FMCG sector.
        
        \item \textbf{News Interpretation:}\\
        This appearance highlights Inspur Digital Business's influence on the international stage and reflects the active expansion of Chinese tech companies in the Southeast Asian market.
        
        \item \textbf{Category:} Technology
        
        \item \textbf{News URL:} Inspur Digital Business Shines
    \end{itemize}
\end{frame}

% Slide 3
\begin{frame}
    \frametitle{Researchers Find Microplastics in Testicular Tissue of Humans and Dogs}

    \begin{itemize}
        \item \textbf{News Details:}\\
        Researchers discovered microplastics in the testicular tissues of both humans and dogs, raising concerns about the potential impact of microplastics on reproductive health.
        
        \item \textbf{News Interpretation:}\\
        The findings could have significant implications for human health, underscoring the severity of microplastic pollution.
        
        \item \textbf{Category:} Health
        
        \item \textbf{News URL:} Microplastic Study Findings
    \end{itemize}
\end{frame}

% Slide 4
\begin{frame}
    \frametitle{Hubble Telescope Explores Barred Spiral Galaxy NGC 4731 in Virgo Cluster}

    \begin{itemize}
        \item \textbf{News Details:}\\
        The Hubble Telescope explored the barred spiral galaxy NGC 4731 in the Virgo Cluster, revealing its detailed colors and structure.
        
        \item \textbf{News Interpretation:}\\
        This research helps scientists better understand the formation and evolution of galaxies.
        
        \item \textbf{Category:} Astronomy
        
        \item \textbf{News URL:} Hubble Telescope Exploration
    \end{itemize}
\end{frame}

% Slide 5
\begin{frame}
    \frametitle{May 2024 Tech Event Calendar Overview}

    \begin{itemize}
        \item \textbf{News Details:}\\
        In May, major tech events include the launch of Chang'e 6, the release of CORSAIR ONE i500 compact high-performance PC, and the MediaTek Dimensity Developer Conference.
        
        \item \textbf{News Interpretation:}\\
        These tech events showcase China's rapid development in aerospace, computer hardware, and mobile communication technology.
        
        \item \textbf{Category:} Technology
        
        \item \textbf{News URL:} May Tech Event Calendar
    \end{itemize}
\end{frame}

% Slide 6
\begin{frame}
    \frametitle{May 2024 Major Tech Events Recap}

    \begin{itemize}
        \item \textbf{News Details:}\\
        May saw a series of important news and highlights in the tech industry.
        
        \item \textbf{News Interpretation:}\\
        These events reflect trends and dynamics in the technology sector.
        
        \item \textbf{Category:} Technology
        
        \item \textbf{News URL:} May Major Tech Events
    \end{itemize}
\end{frame}

% Slide 7
\begin{frame}
    \frametitle{China Coal Science and Technology Corporation Shines at 2024 International Zero Carbon City and Building Conference \& Expo}

    \begin{itemize}
        \item \textbf{News Details:}\\
        China Coal Science and Technology Corporation, along with its subsidiaries, showcased its technology and achievements in zero-carbon city and building construction.
        
        \item \textbf{News Interpretation:}\\
        The participation highlights China's efforts and achievements in green energy and sustainable development.
        
        \item \textbf{Category:} Technology
        
        \item \textbf{News URL:} China Coal Science Shines
    \end{itemize}
\end{frame}

% Slide 8
\begin{frame}
    \frametitle{Preview of May 2024 Tech Events}

    \begin{itemize}
        \item \textbf{News Details:}\\
        Important events include the launch of Chang'e 6, Apple's special event "Fly Away," and the 2024 Google I/O Developer Conference.
        
        \item \textbf{News Interpretation:}\\
        These events forecast the future directions and trends in technology development.
        
        \item \textbf{Category:} Technology
        
        \item \textbf{News URL:} May Tech Event Preview
    \end{itemize}
\end{frame}

% Slide 9
\begin{frame}
    \frametitle{Southeast Asia Tech Internet Event Review}

    \begin{itemize}
        \item \textbf{News Details:}\\
        TechNode reviewed last week's major events in the Southeast Asia tech and internet sector.
        
        \item \textbf{News Interpretation:}\\
        Through the review, one can understand the development trends and dynamics of the tech internet sector in Southeast Asia.
        
        \item \textbf{Category:} Technology
        
        \item \textbf{News URL:} Southeast Asia Tech Review
    \end{itemize}
\end{frame}

% Slide 10
\begin{frame}
    \frametitle{2024 China Home Expo (Beijing)}

    \begin{itemize}
        \item \textbf{News Details:}\\
        The 2024 China Home Expo (Beijing), the 22nd Beijing International Heat Treatment Exhibition, the 11th China Command and Control Conference, and other tech exhibitions will be held at the Beijing National Convention Center.
        
        \item \textbf{News Interpretation:}\\
        The hosting of these exhibitions will further promote the development and communication of China’s tech industry.
        
        \item \textbf{Category:} Technology
        
        \item \textbf{News URL:} 2024 China Home Expo
    \end{itemize}
\end{frame}

% Slide 11
\begin{frame}
    \frametitle{Conclusion}

    These news summaries provide insights into the latest developments and trends in various tech sectors.
\end{frame}

\end{document}

3.对生成latex脚本编译,命令:xelatex ***.tex

PPT模版

1.对用户的输入利用大模型做整理生成合适ppt呈现的排版
2.调用ppt生成tool选择ppt模版
3.调用ppt tool生成ppt

问题

这种实现方式已经对ppt信息可视化做了一层建模,会对用户的输入做理解,重新组合生成合适的呈现方式。重点在于对用户输入信息作排版生成、根据用户输入做关键信息配图检索。
不足点有以下几点:
1.对内容呈现方式做了归类,归多有限的几种排版方式,用户输入对会往这几种排版模式上靠
2.生成的ppt在细粒度控制不够,比如字体、字体颜色区分不同信息…,只能作为粗稿
3.这种生成架构不利于后续产品能力细化提升

以天工Aippt工具为例说明

1.根据用户输入,对内容理解生成合适排版(这部分天工模型做的还是不错,又对信息做了深度理解)
image.png
2.选择ppt模版生成ppt
image.png
生成ppt结果
https://www.tiangong.cn/chat/ai_ppt/025/preview/Q-EP9Xl0BGA

AIPPT

这种方式是目前看到用大模型生成ppt做的最深入的产品。他们大致的思路是:用户内容如何呈现应是需要对用户内容理解选择合适的呈现方式,生成内容可视呈现计划大纲,然后对每部分的内容细化充分的分析挖掘ppt工具的属性来做细粒度优化呈现。
什么意思呢,就是说这个工具会对你输入的内容做理解选择合适的可视化呈现方式(故事呈现大纲不是一层不变的)。
然后会对你输入内容做解构拆解成很多素材语料部件,生成这份ppt呈现的素材库。
充分的理解PPT这种工具的可视化呈现优势,对每部分的素材生成合适的呈现效果,比如:大小、颜色、动效,前后颜色搭配,颜色比对,图表…(这部分何以得知呢,可以根据他动态生成PPT过程看出来,后面会给个视频)

问题:

1.完全的模拟人如何把内容做PPT故事呈现流程建模,很复杂,大模型需要时间沉淀
2.非常吃产品团队对PPT工具的理解,一定要是PPt专家
3.对内容可视化呈现需要深入的了解,这个是个非常重的系统
4.现在这个插件很容易出现ppt生成内容和你输入内容不一致(素材库搭建没控制好,给网络素材检索太大权限)

以扣子上AIPPT插件说明:

image.png
在这里插入图片描述

相关推荐

  1. python实现数据

    2024-06-10 20:02:01       19 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-06-10 20:02:01       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-06-10 20:02:01       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-06-10 20:02:01       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-06-10 20:02:01       18 阅读

热门阅读

  1. 独孤思维:副业圈很多骗子

    2024-06-10 20:02:01       8 阅读
  2. Hive 面试题(九)

    2024-06-10 20:02:01       11 阅读
  3. 力扣395.至少有K个重复字符的最长子串

    2024-06-10 20:02:01       7 阅读
  4. next.js 的几种渲染方式

    2024-06-10 20:02:01       5 阅读
  5. RAG技术在教育领域的应用

    2024-06-10 20:02:01       10 阅读
  6. 关于使用spring boot自带的jackson解析xml心得

    2024-06-10 20:02:01       9 阅读
  7. 第8天:会话管理与Cookies

    2024-06-10 20:02:01       8 阅读