#πŸ”’ PDF

17 messages Β· Page 1 of 1 (latest)

sleek agate
#

I am looking help. I want a program that will review a PDF and i can ask it to create questions and answers. I am new at python thanks again.

urban marshBOT
#

@sleek agate

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

jovial steeple
sleek agate
#

I want the program to be able to pull questions and answers from the text in the pdf

light kraken
#

As in, the PDF already contains questions and answers that you want to extract?

#

Or you want a program that generates questions and answers based on content in the pdf

sleek agate
#

I want it to generate questions and answers

light kraken
#

That's a pretty non-trivial task, but with the advent of LLMs you can probably do it

First, you need to extract the text from the PDF, depending on the PDF you might be able to use some libraries to take it straight from the file, this library looks like an okay one https://github.com/jsvine/pdfplumber

GitHub

Plumb a PDF for detailed information about each char, rectangle, line, et cetera β€”Β and easily extract text and tables. - jsvine/pdfplumber

#

Alternatively you could run it through some OCR service, not sure if there are any that run locally but Google cloud has a decent one

#

Then you want to generate questions and answers, just feed the text of the PDF into openai with your prompt and you're done

sleek agate
#

OCR? I will look it up. I have to create questions weekly and looking for an easier way to do this while learning python

light kraken
#

OCR just means 'optical character recognition', i.e. getting text out of an image

#

Depending on the PDF file, it might be hard to extract text from the file directly, so you'll need something like OCR instead

urban marshBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.