Using ChatGPT4 for Data Analysis

01.05.24

Can you use ChatGPT4 — and custom GPT’s — for investigative journalism, for example, data analysis — most definitely yes! (but be careful): Here is what I have learned converting 39 JPEGs into an all-text Excel file.

TL;DR version:

Was it a more straightforward, faster, and superior method compared to manual analysis without AI? Yes, particularly after realising its limitations with CSV files.

Project Background

I am continually seeking data projects to explore the capabilities and limitations of AI.

This seemed like a fun task: Every week the SDU main canteen post a JPEG on Facebook, with the menu for the following week. Me and my colleague Freja have tried to engage our students in analysing and scrutinising the menu (does it fit the strategy for climate and diversity eg.), but none of them seemed that interested, so… now I’ve done part of it myself. First a disclaimer: I only looked at the main canteen, there is an all-green canteen as well. So this is only part of the picture.

I decided to test if I could get ChatGPT4 to help me do it. And the answer is… kind of. So, if you want to know more about using a GPT for data analysis, come a long for the ride:

Analysing JPEGs and Making a CSV-File

The canteen publishes their menus on Facebook — as a JPEG. Not very data friendly. So, I manually downloaded the JPEGs (boring, but easily done) — I ended up with 39 weeks from week 18 2023 to week 17 2024. And then I asked ChatGPT4 to transcribe the menus. It did an impressively accurate job.

The menu looked like this:

When transcribed, it looked like this:

I then asked it to organising the transcribed data into a CSV format. I requested five columns: week number, day, Danish text, English text, and allergens.

Very structured and nice. It managed to handle days without text (for weeks the canteen didn’t translate the menus and it hadn’t written allergen numbers in the same exact way every week, sometimes they weren’t there at all). And when I asked it to make a downloadable CSV-file, it did. All in all, quite impressive.

However, repeating the same task became monotonous, exacerbated by frequent errors, particularly when processing multiple JPEGs simultaneously.

Developing A Custom Gpt In ChatGPT4

Then I considered: Can I create a GPT (a ChatGPT robot with predefined instructions) and instruct it to transcribe every JPEG, leave sections blank, if there isn’t any available data, move the allergens to the end row (even if they are not written correctly), and compile every dataset into the same CSV file.

The outcome was partial success. The primary challenge was the GPT’s occasional forgetfulness of prior instructions and its inability to add data to an existing file, though it managed to create a new file satisfactorily.

Errors I Encountered:

I had completed 19 weeks by then, but when I switched to .xlsx format, I ended up processing each week again, simply because it felt so satisfying to see how smoothly it consolidated them all into the same .xlsx file.

Xlsx Instead of Csv

Initially hesitant to switch file types, I ultimately found the transition from .csv to .xlsx not only manageable but significantly beneficial.

This is how the errors looked, for the csv-file over and over (it’s in Danish, I mainly wrote everything in English, but at some point, I got tired and annoyed and switched to Danish — I’m sure you catch the drift, even if you don’t know the language).

Then I modified the GPT, adding a .xlsx file to its instructions and converting the format from .csv to .xlsx. This adjustment was straightforward and made a significant difference.

I encountered only 2-3 errors throughout the entire 39 weeks. I still had to add them one week at a time. Writing “Now do week 19” and upload the JPEG. Manageable, but a bit boring.

By the end it looked like this:

Now for the Actual Analysis

I then asked ChatGPT4 to function as a data analyst to identify patterns and propose potential stories for the university newspaper. While it performed adequately, the insights were not beyond what could be achieved through a basic brainstorming session.

Then I tried to ask it to emphasise every meal containing pork with pink text:

It wasn’t impressive.

Apparently butter chicken is pork. While pulled pork isn’t.

When I changed my prompt to ‘act like a chef and look for pork (eg. bacon, ham)’ it went a bit better. I still had to read it myself and correct a few errors (eg. translating fiskefrikadeller to fish meatballs instead of fish fritters and then stating meatballs equals pork).

But all in all:

So if any of my students want to do the actually journalism, they can download the file here (if allergens or English translation isn’t provided, it wasn’t provided by the canteen).

Comparing Other Ai Tools

I tested Claude (3 Sonnet), Co-pilot, and Gemini. Although as well, my testing was not exhaustive, but initial impressions suggest:

All in all, AI can be somewhat buggy regardless of the bot you choose, requiring patience and creativity to devise workarounds when issues arise. However, when used effectively, it can significantly simplify sorting data.

July 8, 2026 · artificial intelligens · in english


Next:The Continued Fight for the Free Internet