Using ChatGPT to extract the summary from a presentation about ChatGPT - an experiment
Generated by DALL-E, with description "a robot looks like Eva in WALL-E, is reading a book, and trying to generate a summary for the book "

Using ChatGPT to extract the summary from a presentation about ChatGPT - an experiment

I recently introduced the ChatGPT to our dev team in a meetup and this blog post serves as a demo of the presentation. The purpose of this post is to showcase how I used ChatGPT to generate a Python script that summarizes my presentation and another post based on the same presentation.

In this blog, I will share my preliminary thoughts on ChatGPT, which I have learned recently. These thoughts are not conclusive and I will try to provide further evidence for some of them in this post.

  1. ChatGPT is a significant achievement in NLP technology development in the past 5-6 years and there are other promising models that compete with it. Big companies have already begun a race for AGI.
  2. Although these models have differences in details, they share common ideas that can be summarized as LLM. As a result, for the general public and normal users, we may see more and more similar interfaces for these models to build more complex applications with natural language inputs.
  3. Given how ChatGPT and similar models are constructed (in terms of time, cost, etc.), and their general interface, they are likely to play a fundamental role as AI-as-a-service.
  4. In the short term, we are still figuring out the business models for using these models. A lot of prompt engineering is still required to unlock their potential.
  5. Companies that require NLP functions may want to consider leveraging the services provided by ChatGPT/OpenAI. For companies that do not have such requirements, they can start thinking about creating some (even if it's just a joke). It is not just tech companies that can benefit from ChatGPT and its competitors.

Let's start with the demonstration of using ChatGPT to create a python script for summarizing my presentation about ChatGPT. In this part of the demo, I will showcase the prompts I used.

Since ChatGPT does not currently offer its model through an API, I am using text-davinci-002-2 (GPT-3.5) for this demo. To provide context, I started by asking ChatGPT if it was possible to use the GPT-3 model to summarize a piece of text programmatically using Python. ChatGPT responded with a six-step process to complete this task.

Next, I asked ChatGPT to generate a program for me and received the following response:

# Step 1: Install the OpenAI API clien
!pip install openai


# Step 2: Import the required libraries
import openai


# Step 3: Set your OpenAI API key
openai.api_key = "your-openai-api-key"


# Step 4: Read the contents of the text file
with open("text_file.txt", "r") as file:
    text = file.read()


# Step 5: Send the input text to the GPT-3 model
response = openai.Completion.create(
    engine="text-davinci-002",
    prompt='Please summarize the following text: ' + text + ' Provide a brief summary that captures the main points and highlights of the text.',
    max_tokens=500,
    n=1,
    stop=None,
    temperature=0.5,
)


# Step 6: Extract the summary from the output
summary = response["choices"][0]["text"].strip()


# Step 7: Store the summary
with open("summary.txt", "w") as file:
    file.write(summary)

t        

The code provided by ChatGPT met my needs and I ran it against the text from my presentation, resulting in the following summary:

OpenAI is a research company that is dedicated to advancing artificial intelligence in a responsible and beneficial manner...... Some fun things you can do with ChatGPT include writing code, providing advice, giving solutions to algorithm questions, creating new programming languages, and helping with design and personal life. If you look back a few years ago at the state of NLP, you'll see that the transformer model architecture relies entirely on self-attention to compute representations of its input and output, without using sequence-aligned RNNs or convolution..... ChatGPT training involves collecting demonstration data and training a supervised policy (cold start stage), sampling prompts and labeling them with high quality, fine-tuning GPT-3, and collecting comparison data and training a reward model......

The summary effectively captured the key points discussed in my presentation. You can also experiment with the code by adjusting parameters such as the temperature to see the effects on the generated summary.

Finally, I attempted to generate a summary directly using ChatGPT, which produced a result that was similar, albeit shorter, to the summary generated by the code. This led me to consider the possibility of creating a blog post based on my presentation. To achieve this, I followed the prompt framework provided in the link (https://github.com/mattnigh/ChatGPT3-Free-Prompt-List) to create a prompt for this demonstration:

Act as an software developer who has some knowledge about GPT and chat GPT, and a blog write
The audience for this blog is developers or professional who are interested in learning about the history of transformer, GPT and ChatGPT


Mentioned the following points:
1. I held a dev meetup with our team to introduce the ChatGPT, to share what I learned recently about ChatGPT, and the focus is the history of GPT evolution. Want to share a summary of my presenation in this blog
2. The presentation include the following points: <the outlines of my presentation, ignored here>
3. ChatGPT helps me to create a python script to extract summary of my presentation with OpenAI API
4. Some my thoughts: <mentioned above , ignore here>        

Unfortunately, the prompt didn't yield the desired results as the generated text didn't have the appropriate style for a blog post and several requirements were overlooked. The root cause of the issue was that it is hard for ChatGPT to understand the organization of my presentation and what a well-structured blog should entail(based on the text I provided). To overcome this challenge, I decided to break down the task into smaller, manageable portions(CoT way).

Act as an software developer who has some knowledge about GPT and ChatGPT, and a blog write
The audience for this blog is developers or professional who are interested in learning about the history of transformer, GPT and ChatGPT.

When responding, use the writing styles of a tech blogger try to introduce a new function of a framework, 

Let's take a segment by segment way, and start from the general introduction segment, by explaining why I write this blog and address the point below:

I introduced the ChatGPT to our dev team in our dev meetup, to share what I learned recently about ChatGPT, and the focus is the history of GPT evolution. Want to share a summary of my presentation in this blog

Keep it as short as possible        

After get the result, submit another prompt:

Sounds good. Let's start the next segment. The following points are included in my presentatio
1. Genenral introduction about OpenAI and ChatGPT
2. What you can do with ChatGPT, especially for developers
3. Tranditional NLP techonology, including tf-idf, CNN, RNN and LSTM, and their drawbacks
4. General introduction about Transfomer Model and how it addresses the drawbacks of troditional way above
5. The relationship between Transfomer and ChatGPT
6. How to train ChatGPT and evolution of ChatGPT
7. General introduction about LLM

Keep point 1 and 3 as brief as possible. limit the length of each point to 200 words.  For other points enrich some tech details, limit the length of each point to 500 words. Keep the style consistent with the paragraph above, like a tech blog. Add necessary connection words between each point n        

During this process, I have a feeling that I need to improve my skill of prompt for such blog writing task. On the other hand, I think maybe it is a good way to prepare a presentation, starting from outline, and then let ChatGPT filling a lot of content.


As a conclusion, you can see I wrote this blog by myself, but I must admin I use ChatGPT to refine my writing(apologize for my poor English). And I want to recap two points I mentioned earlier: we see a general interface for different tasks(coding and write blog), and we still need prompt engineering at current stage. Thanks.

Thanks for sharing your experience Dustin, good work.

Like
Reply

Thanks for sharing your experience Dustin.Good stuff. It is always great to have your insights on the latest technologies. Will look forward to your upcoming post 🙂

Like
Reply

This is great Dustin. I enjoyed reading it. I will comment next my instruction to chatgpt to write a better comment…

To view or add a comment, sign in

More articles by Dustin Wang

Others also viewed

Explore content categories