frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Ask HN: When do you find it sane to delegate to AI?

3•couleur•3h ago•5 comments

Ask HN: What would make ads on a web site more tolerable?

4•psion•5h ago•12 comments

Ask HN: What software and hardware are you sing for self hosted LLM rigs?

35•NegativeLatency•18h ago•14 comments

Ask HN: How can you prepare for the coming security apocalypse?

11•DeepLogin•9h ago•18 comments

Ask HN: Android takes 14GB on my phone. Why does it not include a manual?

18•RetroTechie•1d ago•6 comments

Ask HN: If 2048-bit RSA were cracked, what would be the consequences?

10•partsch•1d ago•7 comments

Ask HN: Founders who shut down a company, what did you do with the code?

8•sethross•19h ago•6 comments

Ask HN: Where is all the amazing AI-generated software?

36•8bitbeep•5d ago•68 comments

Ask HN: Why bother with new programming languages?

15•avilay•1d ago•21 comments

DNS Made Easy: Reset Your Password and Generate New API Keys

8•jinnko•1d ago•3 comments

Ask HN: Is RSA in Jeopardy?

26•lyfeninja•5d ago•17 comments

Tell HN: Don't use AI to write your comments or they'll get automatically killed

44•nathan_f77•1d ago•65 comments

Ask HN: Who is still worried about copyright issues with AI generated code?

6•sonjaqql•2d ago•8 comments

Ask HN: Any courses/products by indie makers worth getting today?

85•akudha•4d ago•43 comments

DietPi released a new version v10.9

21•stephanstsdietp•4d ago•3 comments

Why does Claude have a 4 hour limit?

7•tombakerbuilds•1d ago•3 comments

Ask HN: Coworker rejects PR (a month in) because it does not meet his standards

23•LandOfMightDev•6d ago•46 comments

Ask HN: Why haven't LLMs made any CS breakthroughs?

9•elcritch•2d ago•5 comments

Ask HN: What would you do at your company if RSA rumor comes out true?

4•gouterz•17h ago•1 comments

If you're doing Monte Carlo try Knuth LGC

8•logicallee•2d ago•1 comments

Ask HN: Is anyone using Gemini Live (3.8) in scaled production

5•aenis•2d ago•0 comments

Ask HN: Is ChatGPT output format for chats purposely nerfed?

3•MrCoffee7•1d ago•12 comments

Ask HN: Am I the only one whose AI hype is cooling down a lot?

41•redleathercouch•6d ago•29 comments

Ask HN: How do you find meaning of life at 41?

75•BTA_DoIt•4d ago•128 comments

Ask HN: How do you handle corporate life?

11•busssard•4d ago•10 comments

Ask HN: Users asking to remove their commits under GDPR

10•punkpeye•3d ago•6 comments

Tell HN: 0 Purchases This Thanks Giving

4•prakashn27•2d ago•5 comments

Which city do you live in?

5•Eyyup•2d ago•9 comments

Ask HN: Will GPTs Get Stupider?

4•dfps•3d ago•3 comments

You've reached the end!

Open in hackernews

Ask HN: Best on device LLM tooling for PDFs?

4•martinald•1y ago
I've got very used to using the "big" LLMs for analysing PDFs

Now llama.cpp has vision support; I tried out PDFs with it locally (via LM Studio) but the results weren't as good as I hoped for. One time it insisted it couldn't do "OCR", but gave me an example of what the data _could_ look like - which was the data.

The other major problem is sometimes PDFs are actually made up of images; and it got super confused on those as well.

Given this is so new I'm struggling to find any tools which make this easier.

Comments

raymond_goo•1y ago
Try something like this

  !pip install pytesseract pdf2image pillow
  !apt install poppler-utils
  #!apt install tesseract-ocr
  from pdf2image import convert_from_path
  import pytesseract

  pages = convert_from_path('k.pdf', dpi=300)

  all_text = ""
  for page_num, img in enumerate(pages, start=1):
      text = pytesseract.image_to_string(img)
      all_text += f"\n--- Page {page_num} ---\n{text}"

  print(all_text)
constantinum•1y ago
give https://pg.llmwhisperer.unstract.com/ a try