frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Ask HN: What are you reading?

17•dan-bailey•6h ago•46 comments

Ask HN: Who's still keeping a DOS machine up because the business depends on it?

291•mlaux•4d ago•299 comments

Google now ships "ads" with their Android system update?

5•y42•6h ago•2 comments

Is there a lanscaping tool which can take photos of my garden and make 3D model?

3•Fh_•2h ago•2 comments

Ask HN: How do you get your first users for an MVP?

10•amina124•23h ago•10 comments

Ask HN: React Native or Flutter when the back end is Node?

5•rearview•1d ago•15 comments

Ask HN: What are people doing with their OpenClaw set ups now?

17•will10pa•1d ago•10 comments

Ask HN: Any nerds out there who've read a lot of research papers?

33•shriy-singh•5d ago•28 comments

Management is forcing us to use AI

18•aksjfveoq•1d ago•31 comments

Ask HN: JEV for K1 Tax Forms

4•GoRudy•1d ago•1 comments

macOS 27: ifconfig command no longer prints hardware MAC address

6•luckman212•2d ago•14 comments

Ask HN: IEEE expulsion of Fei-Yue Wang?

12•sathomasga•4d ago•2 comments

I was impressed by Jev, please explain why I shouldn't be

13•effisfor•2d ago•18 comments

Ask HN: Allow agents access to cloud files with least privilege?

6•beerglass•2d ago•2 comments

Ask HN: How are you getting inference for personal projects?

3•variety8675•2d ago•6 comments

Ask HN: Is Opus 5.5 another step change?

17•consumer451•3d ago•19 comments

Tell HN: OpenAI $500 ProMax plan listed in API

29•GustavHartz•4d ago•51 comments

Ask HN: Who is the inspiration for your thinking?

10•SMAAART•2d ago•18 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