ChatGPT's code interpreter for... non-programmers?

Sample prompts and screenshots included!

Edition #6. Approximate read time: 12 minutes

Hi there!

Edition 6 has finally hit your inbox! I’m calling this Think Outside the Box. There’s just over 2,200 words here, making it the longest edition yet!

Here’s what’s in store:

  • Deep Dive (formerly “The Writing”): The re-naming better aligns with the goal of the section. You may have seen some articles about ChatGPT’s code interpreter, especially for data visualization/analysis. I want to show you that you can use this extremely good tool for other kinds of tasks that isn’t focused on software.

  • Any and All AI (formerly “AI Tools”): The section is making a comeback for this edition. It's repurposed it to be inclusive of all things AI-related, from courses to jobs to applications to more. But there’s one caveat to this: You’ll only see this if you’re a subscriber to the newsletter (which you are! 😃).

One last note before we dive in: I am looking for advertisers to help keep this newsletter operating and free for the readers. If you’re interested in advertising, please visit the advertising page.

Now grab that cup of coffee, sit in a comfortable chair, and enjoy.

 

 New here? Grab a cup of coffee - we’re talking AI here. The content that’s in this newsletter is curated towards the integration and applications of AI in our lives, so if this sounds like your kind of thing, hit that “subscribe” button below!

 

This edition is sponsored by me! If you’ve got 30 seconds, it would be greatly appreciated if you fill out a 3 question survey. This survey is anonymous and helps me curate the content to you so that you’re reading about relevant topics.

 

ChatGPT has revolutionized how we do things. You may have used it by now to help you get over writer’s block, generate social media posts, or even asked it questions to see if it qualifies to be on your Thursday night trivia team.

In this deep dive, I want to discuss the power and capabilities of ChatGPT’s code interpreter, but I want to focus on how you can use it even if you don’t know how to write code. I am going to be avoiding data visualization, as there are a lot of tutorials already available for this topic.

Note: Using ChatGPT’s code interpreter requires the premium subscription, which costs $20 a month. If you haven’t yet, give ChatGPT’s free version a try first.

ChatGPT’s logo

ChatGPT’s code interpreter is extremely powerful. It will write Python code to try and carry out the instructions you provided. You do not need to know how to write code, let alone understand it. However, knowing how to read through it could be beneficial so that you’ll have an understanding as to how ChatGPT solved the problem.

Example ChatGPT code interpreter interface

Thankfully, Python relatively easy to read as it is. To boot, ChatGPT does a fantastic job with commenting the code. Remember that you can always include in your prompt “when writing code, be sure to include comments like a 5th grader will read it”.

Before diving in, you’re going to want to keep in mind the following 6 points:

  1. Context is your friend. Be sure to give ChatGPT information it needs to know. The more it knows while you’re prompting, the better your result will be. I wrote about how what makes a great prompt a great prompt in Edition 1.

  2. Hallucinations exist. It may look like the ChatGPT knows what it’s talking about, but it may provide you with false information, even with sufficient “supporting evidence”. I discuss what this looks like in Edition 5.

  3. Don’t prompt with sensitive information. Remember that ChatGPT does retain data and the model is trained on anything you prompt unless you opt out. In fact, this is the reason why Samsung banned ChatGPT.

  4. The output likely won’t be completely satisfactory. This is especially true when you first start working with ChatGPT. In fact, you may want to settle for a “bare bones” output and build the remainder yourself.

  5. The code interpreter can read files. This is very powerful because you’re able to use your own data! You are able to upload popular file extensions such as .txt, .pdf, .doc/.docx, .jpg/.jpeg, .png, .mp4, .csv, .json, .xml, .xlsx, .py, .html, and so much more.

  6. It’ll “forget” things (over time). If you walk away for a period of time, the code interpreter will “time out” and you’ll have to start over, which also means you’ll need to re-upload your files.

Banner to show that the code interpreter has timed out.

2 Examples with prompts and outputs

The in-depth examples below are geared towards academia, but they can be applied to just about any other industry. In these 2 examples, I include the prompt(s) I used and showcase the output. You’ll be able to download the relevant files as well.

 1. Similarities between text.

Suppose that you have a stack of student-written papers that you need to sort through. Before reading through each one individually, you may want to get a preliminary peek to see if there’s any sort of plagiarism between students.

There’s multiple ways to determine the similarities between text documents. I uploaded a zip file with sample papers to mock this scenario and used a cosine similarity method with Doc2Vec. I crafted the following prompt:

Using the provided zip file, please use Doc2Vec to determine similarities between the texts. Please provide the output in CSV file as a similarity matrix in alphabetical order. This similarity matrix should be a cosine similarity matrix.

ChatGPT built a machine learning model, which can cue me into papers were the most similar content wise. After setting conditional formatting in Excel, I was able to take a peek at the data:

Excel output for cosine similarity analysis for a set of papers

The cells in red share very similar content, whereas cells in green differ from one another. You’ll notice a red line down the middle - we would expect these to be red since the same paper is being compared against itself.

In this scenario, we see that paper 6 and paper 7 are red. Does this mean they copied one another? Not necessarily - you can’t conclude from this. Having a red cell tells us that we should look further into these papers, as the content is very similar. It’s important that human intervention is needed (no matter what) and conclusions shouldn’t be drawn right away. Verification and validation of the output is necessary whenever working with this kind of technology.

2. Expedite the course content creation process. 

Content creation is hard. Creating content for a course is even more difficult and time consuming. If you have an outline of what you want to discuss for a class, you can upload this to ChatGPT and tell it to create a PowerPoint to back your lecture, for example.

I borrowed my meteorology professor’s notes (thanks Dr. DeCaria!), uploaded it to ChatGPT, prompted it to generate a PowerPoint based off of the notes, and then provide me the PowerPoint file with the following prompt:

“Attached are lecture notes about clouds for the introduction to meteorology course. I want you to generate a PowerPoint for each section that can be used to lecture a class on each of the points. You don't need to be super detailed, but it does need to reflect the notes I have uploaded.”

The code interpreter did its magic and wrote out code, but it did stop me along the way to make sure it was doing the job it was supposed to do.

ChatGPT provided me with a 17-slide PowerPoint file, mostly filled with the content from the notes. There is some work that needs to get added in (such as a title slide), but overall it’s fairly solid and can be built upon further:

The lecture notes and associated generated PowerPoint

How else can I use the code interpreter?

There’s lots of other ways you can use the code interpreter:

1. Create QR codes easily.

» “Please create a QR code for the following website: https://www.bytesandbrew.com”

  2. Perform semi-basic image manipulation, such as blurring and inverting colors.

» “Please identify the face of the attached image and blur it out.”

3. Read a math equation from an image and have GPT solve it.

» “Please read the math equation from the provided image. Once you do so, repeat it back to me so I know you understand it. Then we’ll solve it.”

4. Convert videos to gifs (I tried this for this edition! Gifs were too large 😢).

» “Please convert the attached video to a gif. Be sure to provide the size of it after converting. We’ll work on scaling it down after you are done.”

5. Edit audio clips to remove filler words and those awkward pauses.

 » “Please remove filler words from the following audio clip such as “uh” and “um”, as well as large pauses.”

6. Convert between file formats with specifications.

» “Please convert the attached text file to a Microsoft word file. All header-like lines should be font size 16, all other text should be size 12.”

Does this mean I should buy a subscription for ChatGPT?

Possibly. You’re not going to want to stitch a gown with a stapler. While the code interpreter may be a viable solution, it may not be the right tool to get the job done.

Maybe it’s worth giving it a shot and seeing how it performs. Of course, it’ll take some time, practice, and skill to get the prompting down. Maybe not even using AI to begin with will do the trick. In fact, is AI the best way to solve problems? We’ll talk about that next edition…

By the way, I love hearing from my audience. If you enjoyed this deep dive, please let me know. Simply respond to this email and it’ll appear in my inbox!

 

Midjourney Generated Image #1

Prompt

Order and chaotic elements merging together for "outside the box" mindset. Pencil sketch style, filled in with colored pencils.”

Midjourney is a generative artificial intelligence program that generates images from natural language descriptions (“prompts”). To use it, you’ll need to join their Discord server. If you don’t have a Discord account, you’ll be able to register for one when you go to join their server.

 

To unlock this section entirely, be sure to subscribe. If you’ve subscribed, log into your account.

  • 😎 Social Media: Postwise - Write engaging social media posts, backed by AI.

  • 📹️ Video Editing: Descript - Edit a video or a podcast much quicker using text instead of a timeline.

  • 🔒️ Image Generation: Subscribe to unlock.

  • 🔒️ Education: Subscribe to unlock.

  • 🔒️ Software: Subscribe to unlock.

  • 🔒️ Bonus: Subscribe to unlock.

In order to see this content, you must be a subscriber to Bytes and Brew. If you’re subscribed, please log into your account in the upper right corner.

 

Midjourney Generated Image #2

Prompt

Thinking outside of the box. Literally.”

 

The phrase “think outside the box” is a phrase that was built upon a puzzle where you had to connect 9 dots with 4 straight lines:

9 dots puzzle with solution

To solve this puzzle correctly, you must be creative with how you look at the puzzle. Instead of working inside the dots, approach it differently by zooming out and giving yourself some space. The phrase “think outside the box” was derived from this puzzle, which was coined originally as “think outside of the dots”.

 

In order to see this content, you must be a subscriber to Bytes and Brew. If you’re subscribed, please log into your account in the upper right corner.

 

Looking for other AI newsletters to subscribe to? The Creative AI Digest newsletter summarizes and brings a different perspective to AI articles. Check out the newsletter archive first, or subscribe below:

 

I truly enjoy hearing from my audience - please reach out and let me know what you like, don’t like, and want to see!

 

Did you enjoy this edition?

Click/tap on your response. Any feedback is super helpful!

Login or Subscribe to participate in polls.

 

☕️ See you next edition 😃 

The next edition will be delivered to your inbox on September 4th

Reply

or to participate.