Kilcullen Science and Engineering

Showing posts with label AI. Show all posts
Showing posts with label AI. Show all posts

Friday, March 13, 2026

Another Use for AI: Reading Tables From Images and Converting to HTML

Mathematical table showing rules of powers
Screenshot of a table. © Eugene Brennan

Artificial intelligence gets a lot of bad press, so I need to write a proper article at some stage about how beneficial I’ve found it to be for all sorts of tasks.

I feel a bit like a “slave owner” at this stage because of the amount of unpaid work it has done for me. I usually use ChatGPT because I reckon it has built up an “understanding” of me—knowing what I want and almost behaving like a pet. I know this from the way it interacts and can reference other aspects of the Kilcullen Science blog, for instance, when I’m tasking it with making changes.


Grok, however, appears to be faster at generating images. I tasked it today with doing some OCR—that’s Optical Character Recognition, the visual equivalent of speech recognition, allowing written or printed documents, or images with text, to be read and the text extracted.

I’m migrating articles to the Kilcullen Science blog from a site I used to write for. One of the articles has a table. I originally designed it using Excel, made a screenshot, and inserted it into the original article as a JPG. That’s adequate as long as small details can be read in the image. However, from a search engine optimisation (SEO) point of view, it’s apparently better to have such data in a proper table implemented in markup—also known as Hypertext Markup Language (HTML). This enables web crawlers to extract the information from tables, and readers can copy and paste information easily. It also supposedly improves the ranking of articles in Google search results or SERPs. A SERP (Search Engine Results Page) is the page a search engine, like Google or Bing, displays after a user submits a query.

The original table is shown at the top of this post. I submitted the JPG to Grok and asked it to convert it to a table, shown below. Then I went one step further and asked it to generate the HTML code. I’ll copy and paste this code into the Blogger editor in HTML view when composing a post, placing it in a suitable position within the post content. I told Grok that I didn’t want any styling on the table—I’ll do that with a table styling template that ChatGPT has coded for me, written in Cascading Style Sheets (CSS). While HTML defines the content and structure of web content, CSS defines how that content will look, allowing hundreds of style attributes such as font type, colour and size of body text and headings to be customised.

I only know basic HTML and CSS, and there’s a lot of detail to learn, but I'm improving. I don't have a great memory, so if I try to learn it, I'll have it forgotten in a few weeks and I'm not going to be designing websites full-time, so there's not much point, hence the outsourcing of feature improvements on my blog to ChatGPT and Grok. Any languages, natural languages like French or English, or computer languages such as C, BASIC, or Java need to be used constantly, otherwise, one forgets the vocabulary and syntax.

Now I have to check the converted table and make sure Grok hasn’t made a cock-up in the conversion!

Table converted by Grok to a proper text table
Image converted by Grok to a proper text-based table, using OCR. © Eugene Brennan

Table converted by Grok to a proper text table
Grok also generated the HTML for the table. © Eugene Brennan

 


Tuesday, May 06, 2025

Deciphering NLI Images

Image courtesy The National Library of Ireland
What's written on the samplers (there's probably a correct term for these) from newspapers outside Bardons in this section of a photo from the Lawrence Photograph Collection in the National Library of Ireland? The photo is the one looking up Main Street from the bridge. "Freeman" seems to be legible at the top of one board, so possibly an ad/excerpt from The Freeman's Journal. Maybe AI could decipher the other content? On the other side of the street, M.A. Egan has a display or ad for "Cadbury Chocolate".
I asked Grok, X's AI assistant. It wasn't much help and presumably because of the data it's trained on, it's biased and coming up with words like "New Jersey". It also didn't make the obvious connection with The Freemans's Journal, although I didn't give it any context for the image. So I asked another question, giving it some extra information this time and it made the connection. It hasn't deciphered what looks like "The Land Act..." on the third board. (Officially "The Land Law (Ireland) Acts according to Wikipedia). Next I gave Grok more context, this was its response:


Eugene: Grok can you decipher this image for me? The boards show ads from newspapers, outside a shop in Ireland in the nineteenth century.

Grok: "Thank you for providing additional context! The image shows several boards displaying newspaper advertisements outside a shop in Ireland during the nineteenth century. The photograph is in black and white, which aligns with the photographic technology of that era, and the boards appear to be promoting various publications or notices. Let’s break down the text on the boards as best as I can, given the image quality.
Left Board:
Top Line: "FREEMAN"
This likely refers to The Freeman's Journal, a prominent Irish newspaper founded in 1763. It was one of the leading newspapers in Ireland during the nineteenth century, known for its nationalist leanings, particularly in the later part of the century when it supported Charles Stewart Parnell and the Irish Parliamentary Party.
Second Line: "NEW JERSEY..."
This part is a bit confusing because "New Jersey" typically refers to a U.S. state, which seems out of place for an Irish context. It’s possible this is a misreading due to the image quality, or it could be referring to a specific edition or a story related to New Jersey (e.g., Irish emigration to the U.S.). However, I suspect it might actually be "NEW SERIES" or something similar, which was a common phrase used in newspaper advertisements to indicate a new edition or relaunch.
Smaller Text Below: The text is too blurry to read in detail, but it likely includes publication details such as the price, frequency (e.g., daily or weekly), or a tagline. For The Freeman's Journal, a typical ad might mention its role as a leading voice for Irish interests, its circulation numbers, or its price (e.g., "Price One Penny").
Middle Board:
Top Line: The text is faint, but it appears to start with "THE LAW OF..." or "THE LAND OF..."
Given the context of nineteenth-century Ireland, this could be an advertisement for a publication discussing legal matters, land reform, or political issues. The Land War (1879–1882) was a significant event in Ireland during this period, involving tenant farmers protesting against landlords. A newspaper or pamphlet might advertise itself as covering "The Law of the Land" or "The Land of Ireland" to attract readers interested in these issues.
Rest of the Text: The smaller text is too blurry to decipher, but it might include details about the publication’s content, such as editorials, legal advice, or reports on land disputes.
Right Board:
Top Line: It looks like it might start with "THE" or "THIS," but it’s very hard to read.
This board is the least clear, and the text is too faint to make out with certainty. It could be advertising another newspaper or a specific article or notice.
Contextual Analysis:
Setting: The boards are placed outside a shop in Ireland, which was a common practice in the nineteenth century for newsagents or general stores to display newspapers and attract customers. The Freeman's Journal was widely circulated in Ireland, so its presence here makes sense.
Historical Context: In the nineteenth century, Ireland was under British rule, and newspapers played a crucial role in shaping public opinion. The Freeman's Journal was known for its advocacy of Catholic emancipation early in the century and later for Irish nationalism. Other publications of the time might have focused on local news, legal matters, or land reform, especially during periods of social unrest like the Land War.
Image Quality: The photograph’s grainy quality and the angle of the boards make it challenging to read all the text. Nineteenth-century photographs often have this level of clarity, especially if they were taken with early cameras or if the image has degraded over time.
Interpretation:
The boards are likely advertising newspapers or related publications available for purchase at the shop. The Freeman's Journal is the most identifiable, and it would have been a major draw for customers interested in national news, politics, and Irish identity. The other boards might be promoting local or specialized publications, possibly focusing on legal or land-related issues, which were highly relevant in nineteenth-century Ireland.
If you’d like more specific details about The Freeman's Journal or other Irish newspapers from that era, I can search for additional information. Alternatively, a higher-resolution image might help in deciphering the smaller text! Let me know how you’d like to proceed."

Wednesday, January 08, 2025

Video From Photos Using AI — Turning Your School Photos into Videos

Image created by Bing Image Creator

Many of us over a certain age don't have any "home movies" of ourselves from when we were young and just handfuls of photos, not like the hundreds or thousands that parents take of their kids today. Imagine if you could turn your photos into home movies?
I've been playing with this AI, video generating online application called Hailuo AI that can turn photos into videos. You might remember Pic Me, the animated TV series for pre-school kids where a child's face was cut out and pasted onto an animated body that got up to all sorts of activities. However this AI technology is light years ahead. Once an image is uploaded, just like with Dall-E, Bing Image Creator or other AI image generating application, a text description of what the video should look like is provided is provided by the user. The application then effectively "skins" the person in the image and wraps their outsides around wire frames it can animate.
The results are somewhat mind boggling. Try it on your old school photos.

Friday, February 16, 2024

Science Friday — The Positives of AI

Image created with Bing Image Creator
Using AI to read diagnostic images, develop new drugs, predict diseases by examining the retina and more. Science Friday presenters Ira Flatlow and Sophie Bushwick talk with cardiologist and professor of Molecular Medicine Eric Topol, founder and director of the Scripps Research Translational Institute in La Jolla, California.

×

Posts by Category