The best Hacker News stories from Show from the past day
Latest posts:
Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
Almost exactly 1 year ago, I submitted something to HN about using Llama2 (which had just come out) to improve the output of Tesseract OCR by correcting obvious OCR errors [0]. That was exciting at the time because OpenAI's API calls were still quite expensive for GPT4, and the cost of running it on a book-length PDF would just be prohibitive. In contrast, you could run Llama2 locally on a machine with just a CPU, and it would be extremely slow, but "free" if you had a spare machine lying around.<p>Well, it's amazing how things have changed since then. Not only have models gotten a lot better, but the latest "low tier" offerings from OpenAI (GPT4o-mini) and Anthropic (Claude3-Haiku) are incredibly cheap and incredibly fast. So cheap and fast, in fact, that you can now break the document up into little chunks and submit them to the API concurrently (where each chunk can go through a multi-stage process, in which the output of the first stage is passed into another prompt for the next stage) and assemble it all in a shockingly short amount of time, and for basically a rounding error in terms of cost.<p>My original project had all sorts of complex stuff for detecting hallucinations and incorrect, spurious additions to the text (like "Here is the corrected text" preambles). But the newer models are already good enough to eliminate most of that stuff. And you can get very impressive results with the multi-stage approach. In this case, the first pass asks it to correct OCR errors and to remove line breaks in the middle of a word and things like that. The next stage takes that as the input and asks the model to do things like reformat the text using markdown, to suppress page numbers and repeated page headers, etc. Anyway, I think the samples (which take less than 1-2 minutes to generate) show the power of the approach:<p>Original PDF:
<a href="https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main/160301289-Warren-Buffett-Katharine-Graham-Letter.pdf">https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main...</a><p>Raw OCR Output:
<a href="https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main/160301289-Warren-Buffett-Katharine-Graham-Letter__raw_ocr_output.txt">https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main...</a><p>LLM-Corrected Markdown Output:
<a href="https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main/160301289-Warren-Buffett-Katharine-Graham-Letter_llm_corrected.md">https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main...</a><p>One interesting thing I found was that almost all my attempts to fix/improve things using "classical" methods like regex and other rule based things made everything worse and more brittle, and the real improvements came from adjusting the prompts to make things clearer for the model, and not asking the model to do too much in a single pass (like fixing OCR mistakes AND converting to markdown format).<p>Anyway, this project is very handy if you have some old scanned books you want to read from Archive.org or Google Books on a Kindle or other ereader device and want things to be re-flowable and clear. It's still not perfect, but I bet within the next year the models will improve even more that it will get closer to 100%. Hope you like it!<p>[0] <a href="https://news.ycombinator.com/item?id=36976333">https://news.ycombinator.com/item?id=36976333</a>
Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
Almost exactly 1 year ago, I submitted something to HN about using Llama2 (which had just come out) to improve the output of Tesseract OCR by correcting obvious OCR errors [0]. That was exciting at the time because OpenAI's API calls were still quite expensive for GPT4, and the cost of running it on a book-length PDF would just be prohibitive. In contrast, you could run Llama2 locally on a machine with just a CPU, and it would be extremely slow, but "free" if you had a spare machine lying around.<p>Well, it's amazing how things have changed since then. Not only have models gotten a lot better, but the latest "low tier" offerings from OpenAI (GPT4o-mini) and Anthropic (Claude3-Haiku) are incredibly cheap and incredibly fast. So cheap and fast, in fact, that you can now break the document up into little chunks and submit them to the API concurrently (where each chunk can go through a multi-stage process, in which the output of the first stage is passed into another prompt for the next stage) and assemble it all in a shockingly short amount of time, and for basically a rounding error in terms of cost.<p>My original project had all sorts of complex stuff for detecting hallucinations and incorrect, spurious additions to the text (like "Here is the corrected text" preambles). But the newer models are already good enough to eliminate most of that stuff. And you can get very impressive results with the multi-stage approach. In this case, the first pass asks it to correct OCR errors and to remove line breaks in the middle of a word and things like that. The next stage takes that as the input and asks the model to do things like reformat the text using markdown, to suppress page numbers and repeated page headers, etc. Anyway, I think the samples (which take less than 1-2 minutes to generate) show the power of the approach:<p>Original PDF:
<a href="https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main/160301289-Warren-Buffett-Katharine-Graham-Letter.pdf">https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main...</a><p>Raw OCR Output:
<a href="https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main/160301289-Warren-Buffett-Katharine-Graham-Letter__raw_ocr_output.txt">https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main...</a><p>LLM-Corrected Markdown Output:
<a href="https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main/160301289-Warren-Buffett-Katharine-Graham-Letter_llm_corrected.md">https://github.com/Dicklesworthstone/llm_aided_ocr/blob/main...</a><p>One interesting thing I found was that almost all my attempts to fix/improve things using "classical" methods like regex and other rule based things made everything worse and more brittle, and the real improvements came from adjusting the prompts to make things clearer for the model, and not asking the model to do too much in a single pass (like fixing OCR mistakes AND converting to markdown format).<p>Anyway, this project is very handy if you have some old scanned books you want to read from Archive.org or Google Books on a Kindle or other ereader device and want things to be re-flowable and clear. It's still not perfect, but I bet within the next year the models will improve even more that it will get closer to 100%. Hope you like it!<p>[0] <a href="https://news.ycombinator.com/item?id=36976333">https://news.ycombinator.com/item?id=36976333</a>
Show HN: The First Non-Smart AI Pendant (NotFriend)
Show HN: Orbit – A CSS radial UI composer framework
Show HN: Orbit – A CSS radial UI composer framework
Show HN: Orbit – A CSS radial UI composer framework
Show HN: I built interactive map of active and decommissioned nuclear stations
Hi all,<p>I am not an expert in nuclear energy but I've always wondered and found it difficult to get a clear picture about the amount of nuclear stations located in a specific region. So I built this tool that shows all the nuclear plants in the world, scaled by their capacity and with indication of their status. Clustering is enabled by default and allows to see the sum potential capacity of a region.<p>It's a fun tool for me: e.g. disable clustering, scale circle radius to 70%, go to EU, and you'll see Germany has shutdown all of the stations. Ofc it's a widely known fact, but what came to my surprise is that Poland, Turkey, Scandinavian countries, Africa have literally 1 to none nuclear stations. Which is kinda strange because some of these regions are modern, well-developed, and Africa specifically was sourcing lots of nuclear fuel for other countries other the years.<p>idk what to do with it yet, but I think I'll come up with ideas for future improvements as I believe nuclear sector will grow drastically.
Show HN: I built interactive map of active and decommissioned nuclear stations
Hi all,<p>I am not an expert in nuclear energy but I've always wondered and found it difficult to get a clear picture about the amount of nuclear stations located in a specific region. So I built this tool that shows all the nuclear plants in the world, scaled by their capacity and with indication of their status. Clustering is enabled by default and allows to see the sum potential capacity of a region.<p>It's a fun tool for me: e.g. disable clustering, scale circle radius to 70%, go to EU, and you'll see Germany has shutdown all of the stations. Ofc it's a widely known fact, but what came to my surprise is that Poland, Turkey, Scandinavian countries, Africa have literally 1 to none nuclear stations. Which is kinda strange because some of these regions are modern, well-developed, and Africa specifically was sourcing lots of nuclear fuel for other countries other the years.<p>idk what to do with it yet, but I think I'll come up with ideas for future improvements as I believe nuclear sector will grow drastically.
Show HN: I built interactive map of active and decommissioned nuclear stations
Hi all,<p>I am not an expert in nuclear energy but I've always wondered and found it difficult to get a clear picture about the amount of nuclear stations located in a specific region. So I built this tool that shows all the nuclear plants in the world, scaled by their capacity and with indication of their status. Clustering is enabled by default and allows to see the sum potential capacity of a region.<p>It's a fun tool for me: e.g. disable clustering, scale circle radius to 70%, go to EU, and you'll see Germany has shutdown all of the stations. Ofc it's a widely known fact, but what came to my surprise is that Poland, Turkey, Scandinavian countries, Africa have literally 1 to none nuclear stations. Which is kinda strange because some of these regions are modern, well-developed, and Africa specifically was sourcing lots of nuclear fuel for other countries other the years.<p>idk what to do with it yet, but I think I'll come up with ideas for future improvements as I believe nuclear sector will grow drastically.
Show HN: I built interactive map of active and decommissioned nuclear stations
Hi all,<p>I am not an expert in nuclear energy but I've always wondered and found it difficult to get a clear picture about the amount of nuclear stations located in a specific region. So I built this tool that shows all the nuclear plants in the world, scaled by their capacity and with indication of their status. Clustering is enabled by default and allows to see the sum potential capacity of a region.<p>It's a fun tool for me: e.g. disable clustering, scale circle radius to 70%, go to EU, and you'll see Germany has shutdown all of the stations. Ofc it's a widely known fact, but what came to my surprise is that Poland, Turkey, Scandinavian countries, Africa have literally 1 to none nuclear stations. Which is kinda strange because some of these regions are modern, well-developed, and Africa specifically was sourcing lots of nuclear fuel for other countries other the years.<p>idk what to do with it yet, but I think I'll come up with ideas for future improvements as I believe nuclear sector will grow drastically.
Show HN: ScholArxiv – an open-source, aesthetic, minimal research paper explorer
Show HN: ScholArxiv – an open-source, aesthetic, minimal research paper explorer
Show HN: Play with an interactive heatmap of SF crime (and other cities)
Show HN: Play with an interactive heatmap of SF crime (and other cities)
Show HN: BudgetFlow – Budget planning using interactive Sankey diagrams
Show HN: BudgetFlow – Budget planning using interactive Sankey diagrams
Show HN: BudgetFlow – Budget planning using interactive Sankey diagrams
Show HN: I've spent nearly 5y on a web app that creates 3D apartments
Show HN: I've spent nearly 5y on a web app that creates 3D apartments
Show HN: I've spent nearly 5y on a web app that creates 3D apartments