# Take a sip of TEI and relax: a proposition for an end-to-end workflow to enrich and publish data created with automatic text recognition

Alix Chagué, Hugo Scheithauer, Lucas Terriel, Floriane Chifoleau, Yves Tadjo-Takianpi

► To cite this version:

Alix Chagué, Hugo Scheithauer, Lucas Terriel, Floriane Chifoleau, Yves Tadjo-Takianpi. Take a sip of TEI and relax: a proposition for an end-to-end workflow to enrich and publish data created with automatic text recognition. Digital Humanities 2022: Responding to Asian Diversity, ADHO; University of Tokyo, Jul 2022, Tokyo, Japan. hal-03739767

HAL Id: hal-03739767

https://inria.hal.science/hal-03739767v1

Submitted on 28 Jul 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
<figure><img src="image_2.png" /></figure>

# TAKE A SIP OF TEI AND RELAX

A proposition for an end-to-end workflow to enrich and
publish data created with automatic text recognition

Alix Chagué, Hugo Scheithauer, Lucas Terriel,
Floriane Chiffoleau, Yves Tadjo-Takianpi

<figure><img src="image_3.png" /></figure>

<figure><img src="image_4.png" /></figure>

DH2022

DIGITAL HUMANITIES 2022

<figure><img src="image_5.png" /></figure>

ALMAnaCH

Inria
# HTR IS A GAME CHANGER TO ACCESS TEXTUAL DATA

* HTR: handwritten text recognition

* Accessible to non-specialists via software like Transkribus or eScriptorium (and others)

* Takes a digitized document and create digital text equivalent after analyzing the layout

* Let the computer work for you and get thousands of text files!

* It works for many types of languages and writing systems

<figure><img src="image_6.png" /></figure>

eScriptorium

<figure><img src="image_7.png" /></figure>

https://gitlab.com/scripta/escriptorium

Transkribus®

<figure><img src="image_8.png" /></figure>

https://transkribus.eu/

<figure><img src="image_9.png" /></figure>
# PIPELINE(S) FOR DIGITAL EDITIONS

Digital
image

## STEP 1

Text acquisition
(HTR)

<figure><img src="image_10.png" /></figure>

TEI

## STEP 2

Post
processing

## STEP 3

Information extraction
(NER, etc)

## STEP 4

Publication

<figure><img src="image_11.png" /></figure>

index & references
# PIPELINE(S) FOR DIGITAL EDITIONS

Digital
image

## STEP 1

Text acquisition
(HTR)

<figure><img src="image_12.png" /></figure>

TEI

## STEP 2

Post
processing

Values?
Conceptual
frameworks?

<figure><img src="image_13.png" /></figure>

## STEP 3

Information extraction
(NER, etc)

## STEP 4

Publication

index & references
# THE CORNERSTONE: TEI XML

<figure><img src="image_14.png" /></figure>

ALTO

<figure><img src="image_15.png" /></figure>

PAGE

* Frequent loss of information during switch from ALTO/PAGE to TEI

* TEI is a stable and documented standard for the representation of texts in digital form

* Extended markup to register every information needed for the source document:

**<SOURCEDOC>**

Data about the <u>coordinates of the</u>
<u>lines and regions</u> on the facsimile and
<u>raw transcription</u>

**<BODY>**

Text and annotations

<figure><img src="image_16.png" /></figure>

TEI

**<TEIHEADER>**

Metadata about the
manuscript description, the
members of the project,
specificities in the content,
etc.
# ENRICHING TEI WITH INFORMATION EXTRACTION

* "Named-entity recognition is a subtask of information extraction

* Locate and classify named entities (person names, organizations, locations, etc.)

Edward Teach **PER**, better known as " Blackbeard **MISC** ", was born at **Bristol LOC** and was an **English MISC** pirate. On 22 November 1718 following a ferocious battle, Teach **PER** and several of his crew were killed by a small force of sailors led by Lieutenant **Robert Maynard PER** in **Ocracoke LOC**, North Carolina **LOC**.

Many possible approaches:

* **rule-based matching**: regular expression, gazetteers.

* **feature engineering-based machine learning**: statistical model trained on word features (wordcase, type of prefix/suffix, word length).

<figure><img src="image_17.png" /></figure>

**neural network**: train an algorithm on pre-annotated entities in dataset.

Typical use cases:

* Information retrieval / faceted search,

* Quantitative or statistical studies based on named entity,

* Entity linking to explore relation with semantic web,

* Build a Knowledge graph to infer new potential sources, etc.
# SEMANTIC@

* Handling TEI XML and Named Entity Recognition is a difficult task.

* Semantic@:

* is a proof of concept, open source and fully customizable,

* offers a graphical user-friendly interface,

* gathers in one place many tools for semantic annotation.

* It relies on existing libraries:

* David Lassner's Standoff converter (https://github.com/standoff-nlp/standoffconverter)

* The Natural Language Processing library SpaCy,

* Flask and SQLite (Front end).

<figure><img src="image_18.png" /></figure>
# SEMANTIC@

<figure><img src="image_19.png" /></figure>

import

XML parsing and
text extraction

standoff-converter

SpaCy

Named Entity
Recognition (NER)

<figure><img src="image_20.png" /></figure>

<figure><img src="image_21.png" /></figure>

03

Manual correction
of NER predictions

RecogitoJS

standoff-converter
/ XSLT

Re-injection of NE
in source XML

<figure><img src="image_22.png" /></figure>

04

<figure><img src="image_23.png" /></figure>

export

<figure><img src="image_24.png" /></figure>
Semantic@ Menu ▼

332 annotations

Search for annotations Clear ?

LOC 273

PERS 13

OHL 25

Semantic@ performs NER task and
inject found named entities into the
TEI file

source document: DAHN Project

(https://github.com/FloChiff/DAHNProject/blob/master/Correspondence/Paul_dEstournelles_de_Constant/Corpus/Lettre0569_30octbr_e1919.xml)

Semantic@'s interface (here to view
named entity extraction)

Example of TEI output, after NER

<figure><img src="image_25.png" /></figure>

<figure><img src="image_26.png" /></figure>
# USING TEI PUBLISHER FOR CREATING A DIGITAL EDITION

- Hosted by exist-db, a software for **NoSQL databases** based on XML,

- **Open source**,

- **Automatically generated** and **customizable web application** for digital editions,

- Display collections of corpora in TEI XML or other markup format, with **templates** in HTML format and **ODD** for the TEI processing model,

- **Search engine** based on metadata and document content,

- Files downloadable to multiple formats (PDF, ePUB, XML, etc.).
# VISUALIZING A TRANSCRIPTION WITH TEI PUBLISHER

**Flat/basic representation** of the transcription
 displayed region by region

**Imitative representation** of the transcription
(leveraging SVG and coordinates)

<SOURCEDOC>

<figure><img src="image_27.png" /></figure>

<BODY>

<figure><img src="image_28.png" /></figure>

**Diplomatic edition** of the source document
(extended markup and additional information, help discovery)

**Facsimile** (source image via IIIF protocol)

<figure><img src="image_29.png" /></figure>
<figure><img src="image_30.png" /></figure>

FACSIMILE

<caption>Mock-up showing the four different views potentially available in TEI-Publisher
(ex. from "Le Pont Mirabeau" by Guillaume Apollinaire)</caption>

FLAT VIEW
PERSPECTIVE AND KEY TAKE-AWAY

* Some missing bricks (or pipes):

* post-HTR correction

* text normalization

* better solutions of complex layouts

* Transparency and flexibility are key features for robust and generalizable pipelines

* TEI provides solution to build pivot files easing the navigation down and up stream

THANK YOU!

<figure><img src="image_31.png" /></figure>