This project leverages the GPT-4V model from OpenAI to tackle questions from Brazil's Enem 2023 exam.
As an initial experiment, I asked the model to solve the mathematics questions. It got 35% accuracy.
Follow these steps to get the Enem solver up and running:
-
Clone the repo with the Enem 2023 exam content.
-
Inside the
enem-gpt4v-solver
directory, whip up a.env
file with your OpenAI API key (note: this API key needs to have access to GPT-4V): -
🗝️ Create a
.env
file within the project directory and insert your OpenAI API key like so:OPENAI_API_KEY=your_api_key_here
-
📸 Screenshot the questions from the exam's PDF and save them into the
questions
folder. Name each screenshot file with its question number followed by the '.png' extension. For example, name the files as 1.png, 2.png, 3.png, and so on. This naming convention is essential for the script to identify and process each question correctly. Note: currently, we have all 45 math questions screenshots in the folder. -
🚀 Execute the
run_enem_2023_solver.ipynb
notebook to begin the question-solving process.
Ensure you have the necessary libraries by running:
pip install requests python-dotenv
- Total Questions Processed: The total number of images in the
questions
folder. - Retries: The number of times the API call was retried.
- Accuracy: The model achieved correct answer rate.
- Time Taken: The duration from start to finish of the question-solving process.
questions/
: Contains the images of the exam questions.reasoning/
: Stores the text files where the model's reasoning is explained.Enem 2023 - Enem 2023 - Caderno de questões da prova amarela do 2º dia
: The exam's PDF.marking_scheme.txt
: The text file with the correct answers (currently holding a non-oficial marking_scheme from O Globo and Etapa).run_enem_2023_solver.ipynb
: The Jupyter notebook to execute the solver.