#๐ [Niche] Is this PDF file parsable?
69 messages ยท Page 1 of 1 (latest)
@neat yew
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.
!rule ai
You could've said "I tried ai and it seems it extracted data, so the file is certainly parseable" ๐ but without actually verifying the result, you don't know whether it did the job fully correctly, hence I brought up the rule
I said ChatGPT can, I didn't pretend I wrote it myself
and a link to the actual ChatGPT chat
The result was also in the Chat so no need to write a moral essay thanks
Bump?
did you try PyPDF2?
BTW I tried uploading it to ChatGPT and it thought I was talking about a facility in Paris
I got it to work in ChatGPT
or rather it made it work
but it was just using PyPDF2
and iterating over the results
nothing too fancy
I'm not interested in trying anything unless someone who has done something similar (extract text from a complex pdf) before tells me it might work because it'll be a lot of effort
But I would use something like PyPDF
it's 3 lines of code
My use case would not be
I mean extracting text is no more than 3 lines of code
I have to extract stoichiometry equations and relate every question to its answers
And parse said stoichiometry equations into HTML
I mean once you have it as text the rest should be fairly easy
Outputs the following text:
COLLISION ONE COLLISION TWO
BEFORE
COLLISION COLLISION AFTER
COLLISION BEFORE
COLLISION COLLISION AFTER
COLLISION
N
O O
F F
F F
N
O O
N
O O
F
F
F F
O O
N
F F
O O
N
F F
O
N
O
yeah that bit requires a bit more parsing
if you want to display it exactly like in the pdf probably yeah
Yeah :(
even if you had that a structured data
unless you're a front end wiz
which I'm not
but the rest should be doable
When I was parsing these by hand I just made a table and slapped some <img> tags in it
yeah could be an option
or you could play with react component but it would take you a long time
if you're not super experienced
If you want a demo you can see it at https://keysdapp.pythonanywhere.com/
This is a proof of concept with only 7 questions so you'll see duplicates
looks cool
Any thoughts for improvement?
when I hover over the answer
Oh, you want like a clicky cursor or something?
there should be a way for the user to figure out that you can click on them
Sounds good
yeah it looks like free form text this way
or maybe have the letters bigger so it's clear you need to click on them
but something to make it more obvious that it's clickable
the rest looks good
Okay I updated it
What do you mean by tick box?
Because usually you tick a box if you're planning on submitting something in the future
checkbox sory
But here it submits right away
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.