Member-only story
A coding question from generative AI: ChatGPT (3.5 and 4) vs. Bard vs. Bing Chat
Writing the initial drafts of code with generative models is awesome! However, how do they handle questions that are not related to data science, which has a lot of Python codes on the internet?
Question (prompt)
Write a code in Python that read notes from a file and plays music. Instead of reading from a “wav” file, read the notes from plain text or a JSON file. You can define the format for the text or JSON file.
TLDR; the winner is ChatGPT 4 and the code is available on GitHub.
Ranking
4. Google Bard: The response was “I’m not trained for coding yet, so I can’t help with that right now.” 😒
3. Microsoft Bing Chat: It worked, but I heard weird loud noises! The generated code uses simpleaudio library. 🥈
2. OpenAI’s ChatGPT 3.5: It worked and the music was not noisy. But it was challenging:
At first, the result was incomplete, I asked for a complete code. Again, incomplete. ChatGPT was struggling while producing the values for the note_map dictionary.
So, I said: Assume notes_map dictionary is already defined, rewrite the code without defining notes_map. This time, the code was complete.