lgabs / gpt-resolve

Can GPT solve Brazilian university entrance exams?
MIT License
13 stars 1 forks source link

Extract Screenshots from PDF Exams #10

Open lgabs opened 5 days ago

lgabs commented 5 days ago

Objective

To automate the process of solving exam questions using gpt-resolve, it would be much more efficient to extract each question as a separate image from a PDF exam. Exams with many questions make the process of extracting questions manually very slow and subject to mistakes.

Some Approaches

OpenCV

  1. Convert PDF to Images: Use tools like pdf2image to transform each page of the PDF into an image.
  2. Segment Questions with OpenCV: Apply OpenCV to detect and isolate individual questions through contour or edge detection techniques.
  3. Save and Name Output: Store each extracted question as a separate image file, naming them sequentially (e.g., q1.png, q2.png).

This method may encounter challenges with questions spanning multiple pages but should effectively process the majority of exams, especially those with numerous pages.

Docling

Consider using Docling, a tool designed to parse documents and export them into various formats, which may assist in extracting questions from PDFs. This can be quite good, since it seems to use advanced models for many kind of document extractions.

Thomas-Ver commented 1 day ago

Hi, i can recommand you this project : https://github.com/opendatalab/MinerU. It's really the top of the top to get informations from a pdf.

lgabs commented 1 day ago

Thanks for the recommendation, @Thomas-Ver ! I'll definitely going to check out that project too.