frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Ask HN: Why are there not more terminal apps?

3•lucasov•35m ago•0 comments

Tell HN: Claude Code adds your email to the prompt, the LLM sends it to websites

7•TekMol•4h ago•1 comments

Ask HN: I Need Advice

7•TuxedoBuddy•7h ago•15 comments

Ask HN: What do you believe or not believe about AI?

20•maniac_2000•1d ago•38 comments

Ask HN: Why big LLMs use "it's not A, it is B" pattern? Shared dataset supplier?

6•jumasheff•8h ago•4 comments

Tell HN: I know Firefox has update when it starts to glitch

2•majkinetor•21h ago•4 comments

Ask HN: Why is pagination gone on "Ask HN", and showing only 19 items?

7•bigwheels•17h ago•3 comments

Expericencing an issue in Gmail where emails do not delete in Firefox

9•rc_kas•2d ago•4 comments

Old.reddit.com Gone

26•Balgair•22h ago•19 comments

DietPi v10.8 has been released

19•stephanstsdietp•1d ago•1 comments

Ask HN: Do you still read clean code and software architecture books?

18•pelcg•2d ago•8 comments

Ask HN: Is it not possible to enroll for Apple Developer anymore?

32•olalonde•3d ago•17 comments

Slow Cloudflare Connections

3•bryonyoni•1d ago•3 comments

Ask HN: T'was the night of Claude Reset and quota left: Funniest app you built?

10•julianpye•1d ago•4 comments

Ask HN: Can we do something about this impending AI dystopia

7•justforfunhere•2d ago•14 comments

Ask HN: Why Is Anthropic's Customer Support Bad?

4•tj-teej•2d ago•8 comments

Is AI just another get rich quick scheme?

18•jqpabc123•5d ago•29 comments

Ask HN: What are your career plans in the age of AI?

13•akudha•2d ago•23 comments

What to do if you discover AI models trained using your copywrighted book?

16•andrea81•2d ago•8 comments

Ask HN: Are tab completion models dead?

22•sandruso•4d ago•17 comments

Ask HN: How do you grow OSS projects?

6•tarasyarema•3d ago•15 comments

Ask HN: We tax labour, why not tax AI?

9•roschdal•16h ago•6 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