Published: 23 May 2023 › Updated: 23 May 2023
🤖Diving into Prompt Engineering: Assessing ChatGPT and Bard for Python Programming😎(by @ace108)
Woke up too early in the morning but not early enough to try to fall asleep again. I decided to whip up and my phone and do a bit of experiment to compare how well ChatGPT do against Bard in Python programming.
🎶Meanwhile, some music for you to enjoy as you read. This piece is part of Vivaldi’s The Four Seasons, particularly the first of the 4 violin concertos, called Spring.
🎶让大家继续读的时候,欣赏一点音乐。这件作品是维瓦尔第的“四季”的一部分 - 4小提琴协奏曲中的第一首,名为“春天”。Source | 来源: https://musopen.org/
https://soundcloud.com/alan-chang-563971986/four-concerti-grossi-4-vivaldi-op8-i-la-primavera-allegro-largo-allegro Source | 来源: https://musopen.org/music/2213/antonio-vivaldi/the-four-seasons/
Half awake (which explained the typo and grammar error), I tried to prompt engineer ChatGPT to tell my the other file format to consider and it listed a few.
I copied the same prompt and run it through Bard and the list is slightly different but the first 3 are the same.
Then I went back to ChatGPT and asked to create a Python function to convert a CSV or (with a typo of "of" instead of "or") Excel file to Parquet with the same filename in the same file folder as the input file and give a table with 3 rows of output with the first two rows showing the input and output filenames and the 3rd row showing the Python code I can use to read in the created Parquet file.
It spat out the code quite fast.
I didn't look at it in detail.
Then I copied the prompt and run it through Bard. The code was also spat out quite fast.
What I saw which wasn't there before was an option to export to Colab which I thought was pretty cool.
So I tried that but I didn’t run it because I didn't have a file for it read.
After I got up, I decided to test the code for ChatGPT first. The output table came out with 3 columns instead of 3 rows I asked out.
I tested the Python code generated from the program to read the Parquet file that was created and it worked quite well.
Then I tried the program created by Bard which gave an error because it was reading my Excel file as a CSV. I guessed it didn't like the typo in my promt.
I fixed that and got a different error. So, I had to do a bit more debugging.
Finally, I tried the the Python code generated from the program to read the Parquet file that was created.
It came out well.
Based on this limited experiment, it is probably not fair to to make a definitive conclusion about which model is better. ChatGPT produced closed to the desired Python code well including accomodating my typo and grammar error but had an issue. Bard didn't do well probably due to typo in the prompt but produced worked after a bit of debugging. Additionally, Bard offered a unique feature to export to Colab, which was nice. So, I think I'd go to ChatGPT first and if the result is good enough, then I can skip Bard.
请看我其他帖:![]()
Leave 🤖Diving into Prompt Engineering: Assessing ChatGPT and Bard for Python Programming😎(by @ace108) to:
Read more #ai posts
Best Posts From ace108
We have not curated any of ace108's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From ace108
- 📷Pickleball Friendly at Warren Golf & Country Club+Video + Video | 华伦高尔夫乡村俱乐部的匹克球友谊赛+视频😎+ 视频😎(by @ace108)
- 📷#BeautifulSunday Breakfast while watching World Cup match at SAFRA Toa Payoh + Video | + 视频😎(by @ace108)
- 📷Volunteer at Safer SG Road Show before pickleball+ Video | 在打匹克球之前,去参加了“Safer SG”路演活动做义工。+ 视频😎(by @ace108)
- 📷Checking out new food court after playing pickleball + Video | 打完匹克球后去新开的食阁+ 视频😎(by @ace108)
- 📷Washed out pickleball games to watching world cup match| 打匹克球泡汤,转战世界杯😎(by @ace108)
- 📷"Raining" in the supermarket+ Video | 超市里“下雨”了+ 视频😎(by @ace108)
- 📷Hokkien Mee at Choa Chu Kang+ Video | 蔡厝港吃福建面+ 视频😎(by @ace108)
- 📷Washed out for one pickleball session | 打了一场匹克球,结果倾盆大雨😎(by @ace108)
- 📷Adidas end of season sale+ Video | 阿迪达斯季末促销+ 视频😎(by @ace108)
- 📷#WednesdayWalk Walking around the market| 在菜市附近逛逛😎(by @ace108)
- 📷BeautifulSunday Late lunch at Feng Food+ Video | 在丰富吃午饭+ 视频😎(by @ace108)
- 📷Watching world cup match after playing pickleball+ Video | 打完匹克球后去看世界杯比赛+ 视频😎(by @ace108)"
- 📷Watching World Cup match at SAFRA Toa Payoh + Video | 在SAFRA大巴窑俱乐部观看世界杯比赛+ 视频😎(by @ace108)
- 📷#BeautifulSunday Watching World Cup match at SRC+ Video | 在新加坡康乐俱乐部看世界杯比赛+ 视频😎(by @ace108)
- 📷Watching World Cup match outside for first time this season + Video | 本赛季第一次在外观看世界杯赛+视频😎(by @ace108)
- 📷Ah Hak Bak Kut Teh + Video | 阿哈肉骨茶+ 视频😎(by @ace108)
- 📷Sesame Street Art at Marina Square+ Video | 滨海广场的芝麻街 + 视频😎(by @ace108)
- 📷Pickleball at Love All+ Video | 在Love All打匹克球+ 视频😎(by @ace108)
- 📷#BeautifulSunday Beautiful Sunday Pao Fan Dinner+ Video | 美丽星期天吃泡饭晚餐+ 视频😎(by @ace108)
- 📷A busy Saturday + Video | 忙碌星期六+ 视频😎(by @ace108)