Codex generating PowerPoint Presentations

Codex generating PowerPointPresentations

I was able to generate PowerPoint Presentations with the help of Codex.

To do this, I used Python + a PowerPoint Library.

Prompt:

"""
Some text that describes the theme of the presentation.
"""

import pptx
from pptx import Presentation
from pptx.enum.shapes import MSO_SHAPE_TYPE
from pptx.dml.color import RGBColor
from pptx.util import Inches

presentation_title = "

Output

It often took more than one try to get a good result, but I still think this is awesome.
It never applied any style, but with the help of PowerPoints Designer and Design Templates, I made a nice presentation in a few minutes.


Idk why im sharing this, just thought its cool

-tiimo

Edit:
Example by @clzn
Google Slides Link

21 Likes

Can we see the presentation ? :thinking:

2 Likes

I’m very curious how far could you push this - could it for example create a ppt presentation based on a blog post, or a jupyter notebook

5 Likes

hi @tiimo can you share the presentation ?

I think the sentiment from the audience is all the same: bravo, now show us the presentation. :grin:

6 Likes

I could not get pptx to install. I had the same prompt as you showed. I ran and obtained what appears to be good Python code. But ‘pptx’ is not found. I tried !pip install pptx and conda install pptx -c conda-forge without luck. Where is pptx?

1 Like

Wow! The codex started to produce slides with text. Then I added, at the end; “#Now create the presentation and launch powerpoint”
and so it did. The launching line did not work, but I could search for the pptx in Finder and launch it. And the contents was good.

1 Like

Here is the output from Codex:

"""
A presentation that describes the development of AI and what awaits in the future. Make it look visually appealing.
"""

import pptx
from pptx import Presentation
from pptx.enum.shapes import MSO_SHAPE_TYPE
from pptx.dml.color import RGBColor
from pptx.util import Inches

presentation_title = “AI and the Future”
presentation_subtitle = “A Presentation by: Nnnnn Nnnnnn”
presentation_author = “nnnnnn”
presentation_date = “September 23, 2021”

prs = Presentation()

Title Slide

title_slide_layout = prs.slide_layouts[0]
slide = prs.slides.add_slide(title_slide_layout)
title = slide.shapes.title
subtitle = slide.placeholders[1]

title.text = presentation_title
subtitle.text = presentation_subtitle

Author Slide

bullet_slide_layout = prs.slide_layouts[1]
slide = prs.slides.add_slide(bullet_slide_layout)
shapes = slide.shapes

title_shape = shapes.title
body_shape = shapes.placeholders[1]

title_shape.text = ‘Author’

tf = body_shape.text_frame
tf.text = presentation_author

Date Slide

bullet_slide_layout = prs.slide_layouts[1]
slide = prs.slides.add_slide(bullet_slide_layout)
shapes = slide.shapes

title_shape = shapes.title
body_shape = shapes.placeholders[1]

title_shape.text = ‘Date’

tf = body_shape.text_frame
tf.text = presentation_date

Abstract Slide

bullet_slide_layout = prs.slide_layouts[1]
slide = prs.slides.add_slide(bullet_slide_layout)
shapes = slide.shapes

title_shape = shapes.title
body_shape = shapes.placeholders[1]

title_shape.text = ‘Abstract’

tf = body_shape.text_frame
tf.text = “In this presentation we will discuss the history of AI and where it is heading.”

History Slide

bullet_slide_layout = prs.slide_layouts[1]
slide = prs.slides.add_slide(bullet_slide_layout)
shapes = slide.shapes

title_shape = shapes.title
body_shape = shapes.placeholders[1]

title_shape.text = ‘History’

tf = body_shape.text_frame
tf.text = “In the 1950s, Alan Turing and John McCarthy created the very first programs that could learn and make decisions. They called it the ‘Turing Test’ and it could distinguish between a human and a computer. The first AI program was called the ‘Automatic Checking Machine’ and it was used to identify the correct spelling of words. The first AI program that could learn was called the ‘Perceptron’ and it was used to identify the correct spelling of words. The first AI program that could learn to play games was called the ‘Tit For Tat’ and it was used to play chess.”

Turing Test Slide

bullet_slide_layout = prs.slide_layouts[1]
slide = prs.slides.add_slide(bullet_slide_layout)
shapes = slide.shapes

title_shape = shapes.title
body_shape = shapes.placeholders[1]

title_shape.text = ‘Turing Test’

tf = body_shape.text_frame
tf.text = “The Turing Test is a test that distinguishes between a human and a computer. The test is named after Alan Turing who created the first AI program. The test works by having a human and a computer communicate with each other. The computer is programmed to impersonate a human. The human is then asked a series of questions and the computer is supposed to answer them correctly. If the human can not tell the difference between the computer and a human, then the computer has passed the test.”

Perceptron Slide

bullet_slide_layout = prs.slide_layouts[1]
slide = prs.slides.add_slide(bullet_slide_layout)
shapes = slide.shapes

title_shape = shapes.title
body_shape = shapes.placeholders[1]

title_shape.text = ‘Perceptron’

tf = body_shape.text_frame
tf.text = “The Perceptron is a program that was created to identify the correct spelling of words. The program works by having a human label words as correct or incorrect. The program then looks at the words that were labeled incorrectly and looks at the ones that were labeled correctly. The program then identifies the words that are spelled incorrectly based on the ones that were labeled correctly. The program then creates a model of what letters and sequences of letters it needs to identify the correct spelling of the word.”

Tit For Tat Slide

bullet_slide_layout = prs.slide_layouts[1]
slide = prs.slides.add_slide(bullet_slide_layout)
shapes = slide.shapes

title_shape = shapes.title
body_shape = shapes.placeholders[1]

title_shape.text = ‘Tit For Tat’

tf = body_shape.text_frame
tf.text = “The Tit for Tat game is a game that was created to play chess against an AI program. The game works by having two players, one being the computer and the other being a human player who plays as white, take turns playing each others pieces on a chess board until one of them wins or there is no more moves left to make.”

#Now create the presentation and launch powerpoint
prs.save(‘AI and the Future.pptx’)

4 Likes

I turned it into a Google Slide Presentation, so other people can see it.

1 Like

How does it look? Visually appealing?

1 Like

no, i dont think the python library can make it look good

I think it also lack the perception of a “visually” something. It is still blind :slight_smile:

1 Like

I am having trouble replicating the powerpoint creation. Either the process stops early or continues ad infinitum without finishing. I am using Davinci Codex, RL=2300, T=0, FP = 0, PP=0. Here is my prompt. Let me know you see something amiss:

`"""
A Powerpoint presentation that describes the development of AI and what awaits in the future. Make it look visually appealing.
Use the Python pptx library.
At the end, create a Powerpoint file.
“”"

import pptx
from pptx import Presentation
from pptx.enum.shapes import MSO_SHAPE_TYPE
from pptx.dml.color import RGBColor
from pptx.util import Inches

presentation_title = “AI and the Future”`

try to edit ypur prompt slighty so u get a diffrent result.
like adding a linebreak, the start of a variable or a new comment

Thanks for the suggestions. I ended up making PP 0.44. Other settings were default (added some for the input length): RL 1787, T 0, TopP 1, FP 0, PP 0.44, BO 1. I used Jupyter notebook, but Colab would work too. I am including the notebook: Dropbox - testppt.ipynb - Simplify your life It created a 2 slide PPT. One other basic thing. I did a copy and paste into Jupyter. The problem with that is that the quotes were all wrong (an artifact of copy/paste) and I had to manually edit them. Then, it ran. This was done in Playground.

1 Like

Very cool - I spend a LOT of time in PowerPoint doing business presentations. I can imagine in X years from now, me typing in some intent and getting a beautiful presentation and my managers be none the wiser :slight_smile:

1 Like

“Visually appealing” is too vague. In all my tries for other scenarios. I got the best results when I gave detailed instructions.

You do need to know the software/library and give sufficient details to get the desirable output.

2 Likes

Hey Timo! Good stuff!

I am the founder of Slidekick.ai - AI presentation builder, powered by GPT-3

It seems like we are moving in the same direction, would love to have a call with you and bounce some ideas. I have sent you a private message. Cheers!

1 Like