frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Tell HN: Namecheap gave my account to an unverified third party

395•Thrashed•7h ago•145 comments

Ask HN: What Linux distro do you daily drive?

16•addajones•5h ago•35 comments

Ask HN: Is there a website that tracks excessive writes to SSDs in OS/app betas?

29•amichail•13h ago•21 comments

Pixel phones getting ad notifications

5•explodes•4h ago•5 comments

Ask: Why does everything Microsoft create lately feel fragile and half-baked?

7•nothrowaways•7h ago•7 comments

Ask HN: If OpenAI hacked HuggingFace, why aren't OpenAI prosecuted?

25•sam_lowry_•17h ago•32 comments

Ask HN: Have you noticed an improvement in AI responses with memory disabled?

3•zbikowski•8h ago•1 comments

Ask HN: What changed in your life when you started meditating (and how)?

30•dondraper36•1d ago•25 comments

Ask HN: Does anyone have an old Goodreads API key?

20•bwb•13h ago•3 comments

Ask HN: Share Your Eccentric Hobby

5•jimnotgym•15h ago•14 comments

Ask HN: How do people keep track of organizational knowledge?

27•kadhirvelm•2d ago•24 comments

New Inference Server for DGX Spark: large model C4:55-90 tok/s no spec decode

4•medicis123•1d ago•0 comments

OpenAI API Is Down

4•whyage•10h ago•3 comments

Are we in the era of AI slop landing pages?

5•aashir-saas•11h ago•8 comments

Ask HN: Will AI assistants become photorealistic video?

3•general_reveal•1d ago•2 comments

Ask HN: How to make AI better at writing prose?

4•remywang•1d ago•6 comments

Ask HN: Alternative Careers in the Age of AI

12•helpfulmandrill•1d ago•11 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