joeylouise / hack-day-automated-alt-text

Wellcome Trust Hack Day - Automated Alt Text

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hack-day-automated-alt-text

Wellcome Trust Hack Day - Automated Alt Text

##Aim

To automatically add alt text to images on Wellcome sites, using object recognition technology, to ensure that no information or functionality is lost if an image is not available to the reader.

##What is alt text?

Alt text (alternative text) allows us to describe a content item, such as an image, on a webpage. For example, the alt text for a photograph of a tabby cat lying down, can be set as ‘Photograph of a tabby cat lying down’.

##Why is alt text useful?

According to Wikipedia, “In situations where the image is not available to the reader, perhaps because they have turned off images in their web browser or are using a screen reader due to a visual impairment, the alternative text ensures that no information or functionality is lost.”

HOWEVER, alt text is sometimes left blank on purpose, so that a screen reader skips over the image. This could be if, for instance, an image was present for purely design reasons.

##What we did

We used Google’s Vision API, which uses object recognition technology to analyse images. The API can also be used for detecting and extracting text within images, as well as face detection, including emotions. We took a selection of images, some with alt text and some without. We targeted those without alt text and if objects in the image were identified, and had a score of more than 50%, the alt text attribute was updated to ’This image may contain: x, y, z’.

##How it can be useful for the Trust

Given we have several websites using lots of images, it can be sometimes hard to write alt text for each and every single image, especially for ones which have been posted in the past where alt text was not mandatory. With the help of the script, all empty or non-given alt texts can contain keywords now.

Another, totally different case could be to use the script as a kind of validator for the intranet to filter images uploaded by users which match certain blacklisted keywords. It also could prevent posting dog pics in the cats group.

About

Wellcome Trust Hack Day - Automated Alt Text


Languages

Language:JavaScript 51.5%Language:HTML 48.5%