Annotated images¶
A new piece of functionality which is currently being introduced allows you to create annotated images. By this, we mean images in LARA texts that contain words and segments annotated in the usual LARA way, so that you can get the usual behaviour when you click on or hover over them. You can see examples of annotated images on the LARA examples page under the heading “LARA pictureboks and phonetic texts”.
You can add an annotated image to your LARA document as follows:
Each annotated image starts with the tag
<annotated_image>
and ends with the tag</annotated_image>
The annotated image needs to contain exactly one ordinary image, defined using the
<img>
tag.Text inside the annotated image is normal LARA text. It is as usual divided into segments with
||
annotations, words can be tagged with lemmas using hashtags, and so on.
A simple LARA corpus file with two annotated images (“Two cartoons” from the LARA examples page) looks like this:
<page>
<annotated_image>
<img src="restaurant_date.jpg" width="800" height="800"/>
chair man glass ||
table ||
glass woman chair ||
</annotated_image>
<page>
<annotated_image>
<img src="trump_cult.jpg" width="831" height="665"/>
Trump#Trump# ladle bleach||
hat idiot ||
idiot hat mug ||
mug idiot ||
hat idiot choking ||
</annotated_image>
Note that the names of the images are specified as restaurant_date.jpg
, trump_cult.jpg
i.e. each one is a base file name and an extension. The first image used looks like this:

The loudspeaker and pencil icons have been added so that audio and translations can be attached to segments as well as words.
Upload the corpus file to the portal, and perform the “Create resources” step.
The first time you do this, the portal will ask you to upload the relevant images as a zipfile. Upload them and perform the “Create resources” step again.
When “Create resources” completes correctly (you may as usual need to correct some other errors first), go to the the Selector Tool page and choose the name of your text from the menu. For the example above, you will see something like this:

Choose the image you want to annotate from the slider. You should now get something like this:

As you can see, the picture is shown on the left and the words on the right, together with an optional audio and translation control for each line. To mark the area associated with a word or control, click around it with the mouse. So for example marking the glass the man is holding will give a result something like this:

Then click on the relevant word, here “glass” in the top row, and you will save the association.
At any point, you can go back to the Portal and run the “Create pages” stage. When you do this, your current word/location data will be automatically downloaded from the Selector Tool and included in your final LARA document. If you are not satisfied, you can go back to the Selector Tool and repeat the cycle.