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

HAL
open science

# TEI Encoding of a Classical Mixtec Dictionary Using GROBID- Dictionaries

Jack Bowers, Mohamed Khemakhem, Laurent Romary

► To cite this version:

Jack Bowers, Mohamed Khemakhem, Laurent Romary. TEI Encoding of a Classical Mixtec Dictionary Using GROBID- Dictionaries. ELEX 2019: Smart Lexicography, Oct 2019, Sintra, Portugal. hal-02264033

HAL Id: hal-02264033

https://inria.hal.science/hal-02264033

Submitted on 6 Aug 2019

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_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# TEI Encoding of a Classical Mixtec Dictionary Using GROBID-Dictionaries

Jack Bowers<fnref n="1" />, Mohamed Khemakhem<fnref n="2" />, Laurent Romary³

¹,<fnref n="2" />,³ Inria-ALMAnaCH - Automatic Language Modelling and ANALysis & Computational Humanities, Paris, France

¹EPHE - École Pratique des Hautes Études, Paris, France

¹ACDH - Austrian Center for Digital Humanities, Vienna, Austria

²UPD7 - Université Paris Diderot - Paris 7, Paris, France

² CMB - Centre Marc Bloch, Berlin, Germany

² BBAW - Berlin-Brandenburg Academy of Sciences and Humanities, Berlin, Germany
E-mail: iljackb@gmail.com, mohamed.khemakhem@inria.fr, laurent.romary@inria.fr

## Abstract

This paper presents the application of GROBID-Dictionaries (Khemakhem et al. 2017, Khemakhem et al. 2018a, Khemakhem et al. 2018b, Khemakhem et al. 2018c), an open source machine learning system for automatically structuring print dictionaries in digital format into TEI (Text Encoding Initiative) to a historical lexical resource of Colonial Mixtec ‘Voces del Dzaha Dzahui’ published by the Dominican fray Francisco Alvarado in the year 1593. The GROBID-Dictionaries application was applied to a re-organized and modernized version of the historical resource published by Jansen and Perez Jiménez (2009). The TEI dictionary produced will be integrated into a language documentation project dealing with Mixtepec-Mixtec (ISO 639-3: mix) (Bowers & Romary, 2017, 2018a, 2018b) an under-resourced indigenous language native to the Juxtlahuaca district of Oaxaca Mexico.

**Keywords:** Mixtec; TEI; GROBID-Dictionaries

## 1. Introduction to the Resource

This paper presents the creation of a TEI dictionary of the earliest lexical resource<fnref n="1" /> of a Mixtec language: the Vocabulario published by the Dominican fray Francisco Alvarado in the year 1593². This resource was automatically converted from PDF format to a structured TEI dictionary using application of GROBID-Dictionaries (Khemakhem et al. 2017, Khemakhem et al. 2018a, Khemakhem et al. 2018b, Khemakhem et al. 2018c), an open source machine learning system for automatically structuring print dictionaries in

<footnote n="1">¹ Not including the codices which were pictographic and not specific to any local variety of Mixtec. Though the author did not represent all the features of the language such as tone, nasalization among other features is resource is thus the first with any representation of the phonetic characteristics of a Mixtecan Language (Jansen & Perez Jiménez, 2009).</footnote>

<footnote n="2">² This document was likely compiled from the few existing resources at the time, namely the Doctrina en Lengua Mixteca by fray Benito Hernández published in 1567 and 1568 respectively from sources compiled in Teposcolula Mexico (Jansen & Perez Jiménez, 2009).</footnote>
digital format into TEI (Text Encoding Initiative). The PDF source used in the
transformation is from a re-organized and modernized version of the historical dictionary
published by Jansen and Perez Jiménez (2009). The TEI dictionary produced contains
roughly 26,600 entries and related entries.

The Mixtec variety sampled by Alvarado to create this vocabulary was that of Yucu Ndaa (Teposcolula) *dzaha dzavui*<fnref n="3" />, which according to the sources is thought to have been used as a lingua franca of the Mixteca region at the time and the language is presently in the field of Mixtecan commonly referred to as “Classical Mixtec” or “Colonial Mixtec” (Jansen & Perez Jiménez 2009).

The vocabulary was produced by the Orden de los Predicadores (O.P.) aka. the Dominican Order, who wanted to learn the language as part of the evangelization efforts in order to be able to communicate with Mixtecs in their own language for the purposes of conversion. In this same year a grammar was published by fray Antonio de los Reyes (also of the Teposcolula - Yucu Ndaa variety)<fnref n="4" />.

There are several inter-related potential uses of the output of this endeavor<fnref n="5" /> for
philological, linguistic, anthropological purposes including: 1) the creation of a machine
searchable data set for the study of the Yucu Ndaa variety itself and/or the
historiographical and philological issues related to the collection and specifics of the
vocabulary collected; 2) create open, highly structured resource for other Mixtecan lexical
projects; 3) combining the first two to potentially create a more cohesive body of pan-
Mixtecan resources and a set of vocabulary for cross Mixtecan comparison; 4) the TEI
format can easily be exported into other formats (e.g. tab separated plain text, etc.) for
non-TEI users, i.e. the format is fully extensible.

And in line with the above, this endeavor was undertaken in order to integrate the contents
of this historical resource into a TEI-based language documentation project dealing with
Mixtepec-Mixtec (ISO 639-3: mix) (Bowers & Romary, 2017, 2018a, 2018b), an under-

<footnote n="3">³ In the present day, there are dozens of Mixtec varieties with different levels of mutual intelligibility, estimates range from 52 (Simons & Fennig 2018) to 85 distinct varieties (Instituto Nacional de Lenguas Indígenas 2015).</footnote>

<footnote n="4">⁴ Both the source of the document Jansen & Perez Jiménez (2009) and Mesolore provide excellent overviews of issues relevant to the study and understanding of the contents of the vocabulary and thus those seeking a more extensive description thereof, should consult these studies.</footnote>

<footnote n="5">⁵ Note these benefits discussed are on top of the essential work done by (Jansen & Perez Jiménez 2009) who made the resource much more user friendly in implementing a number of normalizations, altering the entries to Mixtec -> Spanish, provided an indepth discussion of the source, its context and provided a vision of the resource as a potential basis for pan-Mixtecan etymological and philological comparison. We share this vision and assert that the application of TEI enables the use of the resource as a machine and human readable database.</footnote>
resourced indigenous language native to the Juxtlahuaca district of Oaxaca Mexico<fnref n="6" />. Mixtepec-Mixtec (spoken in the Juxtlahuaca district of Oaxaca) like Teposcolula is in the “Mixteco Alto” region and the linguistic relation between modern Mixtepec-Mixtec and historical variety Yucu Ndaa is quite clear in a significant portion of the vocabulary.

## 2. OCR Technology and Indigenous Language Dictionaries

In recent years there have been growing efforts to apply OCR to digitize indigenous language resources, which is increasingly necessary as language communities are seeking to make the limited materials they have more widely available and to avoid situations where paper copies of content is not only inaccessible but is at risk of complete loss if physical copies fall victim to any number of potential man-made or natural disaster.

Maxwell & Bills (2017) discuss the application of OCR methods in creating a structured, machine readable XML lexicon for indigenous language resources including: Tzeltal-English, Muinane-Spanish and Cubeo-Spanish dictionaries. Additionally, Ranaivo-Malançon et al. (2017) discusses the conversion of Melanau-Mukah-Malay and Iban-Malay indigenous language dictionaries from PDF sources into HTML files which was then parsed using a Python HTMLParser to extract the dictionary content to be saved as comma-separated plain text files.

More advanced approaches using machine learning techniques have seen since few years. The most successful one that showed enough potential for scalability and adaptation is the cascading parsing of print dictionaries implemented in GROBID-Dictionaries (Khemakhem et al. 2017, Khemakhem et al. 2018a, Khemakhem et al. 2018b, Khemakhem et al. 2018c). The technique is based on Conditional Random Fields (CRF) (Lavergne et al. 2010) which allow, along with dedicated libraries for manipulating PDF documents, an end-to-end extraction of lexical structures into TEI compliant resources. Being language agnostic and the extensibility of GROBID-Dictionaries have motivated our present work to speed up the process of building a structured resource for the historical Mixtec language resource.

### 2.1 Different Versions of the resource

In both the automatic structuring process used to create the TEI dictionary and in the specifics of the content, the history of the organization of the lexical resource plays a significant role. While the original dictionary created by Alvarado was Castillian - Mixtec, the version by Jansen & Perez Jiménez (2009) was transformed to be Mixtec - Castillian. Below is an example of the original Castillian - Mixtec entry structure taken

<footnote n="6">⁶ Mixtepec-Mixtec is an Otomonguean language spoken by roughly 9,000 – 10,000 people, and in addition to the native communities in Mexico, it is also spoken by communities of several people living in California, Oregon, Washington, Florida and Arkansas in the United States.</footnote>
from the PDF version with the original structure created by Mesolore. This lexicon not
only is Castilian based, but is organized in a way in which an entry often contains
multiple Mixtec forms, have unclear indicators of grammatical information, the
components of the Mixtec items are not appropriately delimited, in some cases they
were not consistently spelled, and finally in many cases the Mixtec forms had other
senses that were placed in separate entries. Thus, the original content was not a user-
friendly resource.

(373, 410, 756, 540],

<caption>Figure 1: Dictionary structure prior to the restructuring of Jansen & Perez Jiménez (2009)</caption>

Jansen & Perez Jiménez (2009) split up the contents of this into five separate entries and applied several normalizations to the orthographic representation to both produce a more uniform convention. These changes both improve the organization of the Mixtec content and more clearly reflect the linguistic structure. The results of which are shown below<sup>7</sup>:

**yodza cay noondi**: deshollejar; abajar la cabeza para mirar algo profundo; aceptar persona; anillo poner en el dedo; echar los ojos en algo; inclinarse bajando la cabeza para mirar hacia abajo; poner los ojos en algo para hurtarlo; poner los ojos en algo que parece bien
**yosito ninondita, futuro coto**: aceptar persona
**yotniño nuundita**: aceptar persona
**yona quay nuundita**: aceptar persona
**yona quay cahandi sita**: aceptar persona

<caption>Figure 2: Revised version of entry shown above, separated into four separate entries in Jansen & Perez Jiménez (2009)</caption>

The changes made in the aforementioned source, particularly the use of bold type for
the Mixtec forms, the addition of a colon ":", semi-colon ";", and comma "," delimiters

<footnote n="7">⁷ Note in Figure 2, the Spanish gloss of the entry **yodza cay noondi** contains content that was not in the original shown in Figure 1; this was apparently taken from elsewhere in the original dictionary as *yodza cay noondi* was been given as the gloss for multiple Spanish terms. One of the major achievements of Jansen & Perez Jiménez (2009) was the consolidation of this information.</footnote>
between form and sense, different senses, and separate glosses in a single sense respectively rendered the contents much more amenable to the application of the GROBID as the contents of entries are much more clearly demarcated. Issues specific to GROBID will be discussed in more depth in the following section.

## 3. GROBID-Dictionaries

### 3.1 System Overview

GROBID-Dictionaries (Khemakhem et al. 2017, Khemakhem et al. 2018a) is a machine learning infrastructure for parsing and structuring digital dictionaries based on CRF models (Lavergne et al. 2010). The infrastructure has been tested with digitized and born digital dictionaries in several languages, and is still under development. In the following section, we present the part of the tool's up to date architecture reflecting the logical (lexicographic) structure of the present dictionary.

### 3.2 Cascading CRF models for Lexical Information Parsing

The lexical information extraction in GROBID-Dictionaries relies on a cascade parsing of the structures in an input dictionary. At each parsing level a CRF model, being trained on samples of the target dictionary, has the goal of predicting a set of labels representing TEI structures. In Figure 3 we present the architecture of different models and labels recognized by the system in the case of the present dictionary.
<figure><img src="image_3.png" /><figcaption>Figure 3: Parts of GROBID-Dictionaries' architecture activated for parsing the Mixtec dictionary</figcaption></figure>

As a reminder, a text cluster recognized by a CRF model could be either directly
wrapped into a valid TEI structure - represented in Figure 3 with angle brackets - or into
a pivot XML element - represented in Figure 3 without brackets. Pivot elements are
implemented when a TEI construct is typed, such as <form> element that could be typed
with either "lemma" or "inflected", or as for definitions which are serialized in TEI using
<def> construct. We have used pivot elements just for the training stage which are then
rendered in the final output as a valid TEI construct. <pc> is present at almost all
segmentation levels as marking up such information is useful for the machine learning
model to learn field limits in a continuous sequence of tokens. A simple find/replace post-
processing can remove such valid TEI tags if needed.

Compared to what has been already achieved in Khemakhem et al. (2018a), several
improvements have been carried out to cover more lexical features encountered both in
this dictionary as well as in other samples of similar lexical description depth:

1. Forms in lexical entries are differentiated into lemma and inflected

2. Form model parses morphological and grammatical information of different forms replacing the old model which was designed to extract the main information related to the lemma

3. After being extracted and segmented into sub-senses, if semantic nesting needs to be reflected, senses can be parsed by a SubSense model to recognize definitions, usage, grammatical information and translation equivalents.
## 3.3 Experiment

In training the different models required in the architecture we have encountered several challenges related to the logical and physical (typographic) structure of the dictionary. We detail in this section the major obstacles, the implemented solutions, the impact on the annotation process and the results of the experiment.

## 3.4 Automatic Parsing: Features and Challenges

The logical structure of the dictionary has been affected by the fact that dictionary had been re-compiled from an earlier version, which as mentioned above, greatly improved the quality and organization of the resource in many ways. While the dictionary looks fairly simple in structure, due to a mixture of issues related to the original vocabulary collection in combination with some conventions in the updated formatting which are not clearly specified by Jansen and Jiménez Perez (2009), it contains some complexities which pose some serious obstacles to parsing, most of these features are described below.

### 3.4.1 Forms and related entries

While thanks to the revisions by Jansen and Jiménez Perez (2009) the form section is nicely delimited from the sense by the use of the bold type, there are nonetheless quite a few different features present in that section with unique conventions for demarcation.

The most common supplemental feature in the forms is the inclusion of an inflected form (which is only a single part of the verb phrase), which is delimited by the combination of a comma, followed by the grammatical feature in italic type.

**yosico ini tnahandi, futuro cuico:** aficionados estar dos

<caption>Figure 4: Entry with inflected (future) form *cuico*</caption>

There are several different conventions used in related entries and variant forms, none of which have enough instances sufficient for automatic recognition and structuring:

**huau ndaha / saha:** artejo

<caption>Figure 5: Entry for “knuckle” specific to “hand” *ndaha* or “foot”</caption>

In the entry *huau ndaha/ saha* the form *ndaha* is “hand” while *saha* is “foot”, thus the content is a related entry and is only part of the full form of the second lexical entry (as the lexical items for knuckles in Classical Mixtec are equivalent to “hand knuckles” and “foot knuckles”). In the entry below, it appears that there are alternate terms which
translate into Spanish as *en buen tiempo* (“in good time”) and these alternative phrases
are separated by the first comma with the grammatical feature (either verbal tense or
mood) preceding the inflected form.

**quevui iñe huaha, quevui iñe huii, futuro cuiñe:** en buen tiempo

<caption>Figure 6: Entry with variant term for part of phrase *huaha* ~ *huii*</caption>

In only a few instances, where the entry itself is an inflected form of another entry this
information is stated in square brackets within the form (bold) portion of the entry.
However, this content is mixed between the feature (below *imperativo*), Spanish de, and
then the Mixtec form (below *yosa cahindi*). These instances are actually duplicates of
existing entries.

**qua cahi [imperativo de yosa cahindi]:** ir por algo generalmente

<caption>Figure 7: Entry whose form is an inflected form of a separate (related) entry</caption>

3.4.2 Sense information

In entries with multiple gloss-like definitions but which are to be considered a single sense,
commas separate the contents<fnref n="8" />:

**quevui yahui:** feria, mercado

<caption>Figure 8: Entry with two glosses of a single sense</caption>

In some cases, the entry is divided into multiple senses (which themselves have one or
more gloss), these separate senses are delimited by semicolons.

**ñuhu nisitu:** cavada tierra; labrada tierra

<caption>Figure 9: Entry with two distinct senses</caption>

There are cases of exceptions to these, for instance, which the comma usually delimits
different glosses, in a few examples, they are used in a normal grammatical way, delimiting
clauses. In the following example, the definition is *fofa cosa* “soft thing” and the content
after the comma states “such as dirt”.

<footnote n="8">⁸ Despite the structuring, there are many cases in which the use of the sense delimiter “;” does not seem to delimit strictly distinct senses.</footnote>
**ñuhu tisaha:** fofa cosa, como tierra

<caption>Figure 10: Entry showing comma delimiting separate glosses of same sense</caption>

### 3.4.3 Usage, etymology grammatical information

In many entries there is supplemental information about the sense given by the original author which generally specifies some aspect of the usage. This is represented in the Jansen and Jiménez Perez (2009) version in round brackets.

**ama:** bien está (otorgando); sí

<caption>Figure 11: Example of usage information in sense</caption>

Likewise, there are some entries with supplemental information which is grammatical in nature which is also placed in round brackets but is distinguished from the usage information with italics.

**amana:** ¿cuándo? (adverbio interrogativo), ¿en qué tiempo?

<caption>Figure 12: Example of grammatical information in sense</caption>

However, there are certain cases in which there is grammatical information as well as a translation in the round brackets. Though the structure is distinct in that within the brackets, the grammar information is in italics delimited by a colon and the Spanish translation is to the right of the colon, there are not enough instances to train the system to automatically recognize this.

**ca nayndo saha qhundo:** llevar alguna cosa (imperativo: llevarás esto)

<caption>Figure 13: Example of grammatical information and translation of inflected form in sense</caption>

In some entries Jansen and Jiménez Perez (2009) added notes of where the sense is metaphorical in nature, these also are represented in round brackets within the sense section. The number of these instances is also not sufficient for the system to recognize and structure this content.

**ña tuvui nini dzavua yuqua iyondi:** vivir pobre (por metáfora); pobre estar

<caption>Figure 14: Example of metaphor specified in sense information</caption>
### 3.4.4 Other issues

Hyphenated content which is present in the source due to line breaks and additional varied use of brackets for various lexical content are also present in the data source and contain too few instances to provide enough training data annotations for ML to create the desired output. Such content (as well as those mentioned above which lack sufficient quantities required for successful training) are structured in the TEI output either manually, semi-manually, or automatically using XSLT and much of which will be described in a later section.

## 3.5 Annotation

Covering instances of all the aforementioned observations in few pages for the annotation is a very hard task. And given the multi stage annotations, where the annotation is focused at each level on marking up all possible variations of specific structures, the number of the required pages to be annotated can grow exponentially.

## 3.6 Page Sampling Process

As a random sampling was not an option in the case of this dictionary, we tried to cover the variation of logical and physical structures by selecting pages that represent the maximum of challenges. We selected just a few pages containing related entries as they are sparsely distributed and we also had to give up the annotation of some structures such as “morphological variants” given their few number and inconsistent typographic representation. More useful information about language, comparison, transcription, etc. in prose section, we decided to ignore in the scope of this experiment.

We have selected and annotating 14 pages from different spots of the dictionary: 10 for training and 4 for evaluation. We detail the annotated instances for each model, except for the first one dealing with the prediction of main regions of a page which has less lexical importance to the scope of this work, in the following table:

<table><thead><tr><th>Model</th><th>Training</th><th>Evaluation</th></tr></thead><tbody><tr><td>Dictionary Body Segmentation</td><td>572 &lt;entry&gt;</td><td>270 &lt;entry&gt;</td></tr><tr><td>Lexical Entry</td><td>572 &lt;sense&gt;<br>572 &lt;lemma&gt;<br>28 &lt;inflected&gt;<br>10 &lt;re&gt;</td><td>269 &lt;sense&gt;<br>270 &lt;lemma&gt;<br>10 &lt;inflected&gt;<br>4 &lt;re&gt;</td></tr><tr><td>Sense</td><td>856 &lt;subSense&gt;</td><td>302 &lt;subSense&gt;</td></tr></tbody></table>
<table><caption>Table 1: Page Sampling Statistics</caption><tr><td>Form</td><td>787 &lt;orth&gt;<br/>31 &lt;part&gt;<br/>31 &lt;gramGrp&gt;</td><td>269 &lt;orth&gt;<br/>11 &lt;part&gt;<br/>11 &lt;gramGrp&gt;</td></tr><tr><td>SubSense</td><td>905 &lt;def&gt;<br/>32 &lt;usg&gt;<br/>7 &lt;gramGrp&gt;<br/>9 &lt;translation&gt;</td><td>319 &lt;def&gt;<br/>11 &lt;usg&gt;<br/>8 &lt;gramGrp&gt;<br/>2 &lt;translation&gt;</td></tr></table>

## 3.6 Results and Discussion

The results of the first two models, **Dictionary Segmentation** and **Dictionary Body Segmentation** reached an almost perfect result - above 98 F1 score. In the following table we detail the performance of the rest of the models on the field level in which the evaluation takes into consideration the prediction of all token of field and not only single tokens. We don't show the evaluation of the **Grammatical Group** model as it has only one label.

<table><thead><tr><th>Model</th><th>Label</th><th>Precision</th><th>Recall</th><th>F1</th></tr></thead><tbody><tr><td rowspan="5">Lexical Entry</td><td>&lt;inflected&gt;</td><td>90</td><td>90</td><td>90</td></tr><tr><td>&lt;lemma&gt;</td><td>99.26</td><td>99.26</td><td>99.26</td></tr><tr><td>&lt;pc&gt;</td><td>98.94</td><td>99.29</td><td>99.12</td></tr><tr><td>&lt;sense&gt;</td><td>100</td><td>100</td><td>100</td></tr><tr><td>&lt;re&gt;</td><td>0</td><td>0</td><td>0</td></tr><tr><td rowspan="2">Sense</td><td>&lt;subSense&gt;</td><td>100</td><td>100</td><td>100</td></tr><tr><td>&lt;pc&gt;</td><td>100</td><td>100</td><td>100</td></tr><tr><td rowspan="3">Form</td><td>&lt;gramGrp&gt;</td><td>100</td><td>90.91</td><td>95.24</td></tr><tr><td>&lt;orth&gt;</td><td>98.18</td><td>100</td><td>99.08</td></tr><tr><td>&lt;part&gt;</td><td>70</td><td>63.64</td><td>66.67</td></tr><tr><td>SubSense</td><td>&lt;def&gt;</td><td>91.84</td><td>95.3</td><td>93.54</td></tr></tbody></table>
<table><caption>Table 2: Field Level Evaluation of the Lexical Models</caption><tr><td></td><td>&lt;gramGrp&gt;</td><td>100</td><td>25</td><td>40</td></tr><tr><td></td><td>&lt;pc&gt;</td><td>76.81</td><td>88.33</td><td>82.17</td></tr><tr><td></td><td>&lt;translation&gt;</td><td>100</td><td>100</td><td>100</td></tr><tr><td></td><td>&lt;usg&gt;</td><td>60</td><td>90</td><td>72</td></tr></table>

The evaluation shows a high performance of the models in predicting lexical structures with the exception of related entries, grammatical information, sense usages within sense and orthography of inflected forms.

In the case of related entries, the training and evaluation datasets combined contain just 32 instances representing 2 logical representations (collocates and non-collocates) and 4 physical variations (with/without brackets and with/without commas). We consider the quantity of instances used for training is not sufficient for the **Lexical Entry** model to learn the distribution of such a structure.

For usage and grammatical information blocks, both structures are represented within senses as textual sequence wrapped in a round brackets. The only physical difference evident is the italics used to mark the grammatical information. An in-depth investigation has shown that such a visual variation has not been translated consistently in the layout information associated with each token of the document and being extracted by the PDF utilities libraries in GROBID-Dictionaries. Therefore, the **SubSense** model remains unable to differentiate these two physically similar structures. In the case of <part> label, more annotated instances seem to be needed in the training dataset to strengthen the predictions of the **Form** model.

## 4. TEI structure of output

Because this resource is being converted to TEI in order to be integrated with the TEI-based project on the contemporary Mixtepec-Mixtec variety<fnref n="9" />, the Classical Mixtec dictionary structure is designed to match the former as much as possible. The exception to this is that due to the inexact nature of the Spanish glossing the default element

<footnote n="9">⁹ For an in depth detailing of the structure and content in the Mixtepec-Mixtec TEI dictionary, see Bowers and Romary (2018a)</footnote>
containing the Spanish is the definition element `<def>`, whereas is the Mixtepec-Mixtec TEI dictionary they are represented as pure translations.

## 4.1 Basic entry structure

<figure><img src="image_4.png" /><figcaption>Figure 15: Left partial TEI dictionary entry for *nchika* 'plantain' in Mixtepec-Mixtec; Right view of (unenhanced) structure of the historically related form in Classical Mixtec</figcaption></figure>

Note that while the ISO 639-3 language code is applied to the Mixtepec-Mixtec entry and the Spanish 639-2 tag is applied to the translations of the Classical Mixtec entry, there are no ISO or other any other standardized language codes for 'Classical Mixtec', nor is there any documented modern Mixtec variety attributed to Teposcolula.

## 4.2 Inflected forms

The entries with inflected forms are shown below in the TEI output. Note that since these are mostly multi-word expressions verb phrases.

**yosico ini tnahandi, futuro cuico:** aficionados estar dos

<caption>Figure 16: Entry with inflected form</caption>
<figure><img src="image_5.png" /><figcaption>Figure 17: TEI encoding of entry with inflected form</figcaption></figure>

## 4.3 Senses

Entries with multiple senses and multiple glosses/definitions were generally handled well by GROBID, examples of the output of each case (unenhanced) is shown below with the source from the PDF entry above.

ñuhu nisitu: cavada tierra; labrada tierra

<entry>
  <form type="lemma">
    <orth>ñuhu nisitu</orth>
  </form>
  <pc>:</pc>
</entry>

<sense>
  <def>cavada tierra</def>
</sense>

<sense>
  <def>labrada tierra</def>
</sense>

ñuhu tisaha: fofa cosa, como tierra

<entry>
  <form type="lemma">
    <orth>ñuhu tisaha</orth>
  </form>
  <pc>:</pc>
</entry>

<sense>
  <def>fofa cosa</def>
  <def>como tierra</def>
</sense>

</entry>

<caption>Figure 18: TEI encoding of entries with multiple senses and multiple definitions</caption>

## 5. Post-editing: Modifications and enhancements

In terms of the source to target structure, the GROBID process was able to create a conversion of the PDF form of the resource into TEI which represented the majority of the features present in the dictionary. However, in the case of several features, further
manual and semi-manual encoding enhancements were necessary in order to create a
more dynamic and refined structure. These modifications were necessary due to either:
a lack of sufficient token required for the machine learning process or to make it more
compatible with the Mixtepec-Mixtec TEI corpus. In this section they are described.

Other key enhancements made to the output include the following:

* Spanish ISO 639-2 language tag added to all `<def>` elements

* Unique id's (@xml:id) are added to each `<entry>` and `<re>` which are based on the Spanish value (with underscores and token numbers added as needed)

* English translations are being added according to certain categories (at least for those which are sufficiently clear, as not all items can easily be translated)

* Domain tag (`<usg type="domain">`) is added in certain entries (some of the vocabulary in the source which are initially given `<usg type="hint">` can be changed to domain)

* Record of normalizations and assumed phonetic equivalencies made by Jansen and Jiménez Perez (2009) are manually added in the header.

Below we discuss the formatting of content which was not sufficiently structured by GROBID and/or which needed additional structuring to bring it in line with best practice in TEI. In the examples we show both the output of GROBID and the revised TEI structure.

**5.1 Related entries**

In most cases related entries were correctly identified as such by GROBID, however
because there are a number of different types of related entries most of which lack
sufficient instances to train the system automatically recognize and encode then in
detail, these items are manually refined in TEI.

tay huasi cana / cay idzi yuhu: mozo que comien-za a barbar

<caption>Figure 19: Entry with related entry in source</caption>
<figure><img src="image_6.png" /><figcaption>Figure 20: GROBID output (left) with revised TEI structure of form with related entry (right)</figcaption></figure>

## 5.2 Collocate phrases in the form

In a small number of cases, there is collocate information included in the form. In TEI this is encoded using the `<colloc>` element.

**caa ndodzo ninondi (nuu sito):** echado estar (en la cama)

<figure><img src="image_7.png" /><figcaption>Figure 22: GROBID output (left) with revised TEI structure of form with collocate (right)</figcaption></figure>

## 5.3 Modern Spanish Translations

There were a number of modernized Spanish translations added by Jansen and Jiménez Perez (2009) which were placed in square brackets.

**da queyeni:** aprisa; incontinenti [luego]; y luego; luego a la hora; temprano

<caption>Figure 23: Entry with modernized Spanish translation in source</caption>
<figure><img src="image_8.png" /><figcaption>Figure 24: GROBID output (left) with revised TEI structure of modernized Spanish translation (right)</figcaption></figure>

## 5.4 Inflected forms

In certain cases, even though the source did not have a given feature explicitly labeled, what they did include could be used to infer, and then add key features in order to enhance the content and bring it in line with general lexicographic practice. One area where this was possible is where there were inflected forms.

**yosico ini tnahandi, futuro cuico:** aficionados estar dos

<caption>Figure 25: Entry with inflected form in source</caption>

In these entries with the feature **futuro**, there are two inferable features: first, that the entry is a phrase, (mostly which do not seem to have had simple lexicalized items in Mixtec), second, that given that the feature **futuro** is a feature of tense, that the part of speech verb can be inferred. The example below shows how these features are represented in the revised TEI structure by adding the @type="phrase" to <entry>, adding <pos>verb</pos> to the entry level, and by changing the generic <gram> to <tns> in the inflected future form10. This enhancement process is done using XSLT.

<footnote n="10">¹⁰ The reason that we did not train GROBID to automatically annotate the feature *futuro* as <tns> is that there are some instances of imperative forms listed in the same way. Thus, each of these features is further treated using XSLT specifically targeted, with the imperative forms being output in TEI as: `<gram type="mood">`.</footnote>
<figure><img src="image_9.png" /><figcaption>Figure 26: GROBID output (left) with revised TEI structure of phrasal entry with inflected form (right)</figcaption></figure>

## 5.5 Addition of original prologue

As there were different PDF versions of this resource, some of them included content from the original that were not included in the others. Notably in the version of Jansen & Perez Jiménez (2009) the original prolog content published in the original were not included, this content was added manually and is easily represented in the TEI output.

YO FRAY Gabriel de Sancto Ioseph, Prior Prouincial desta Prouincia de Sanctiago de la Nueua España Ordinis Predicatorum. Auiendo visto el examen, y aprouacion del Vocabulario Misteco, hecho por los Padres de aquella nacion, aquienes por mi fue cometido. Y siendo vtil y prouechoso como consta por la dicha aprouacion, por la presente doy licencia al Padre Fray Francisco de Aluarado, Vicario de Tamaçulapa: para que pueda imprimir el dicho Vocabulario: con las censuras y notas de los dichos examinadores, juntamente con el Arte que de la dicha lengua Misteca compuso el Padre Fray Antonio de los Reyes, Vicario de Tepusculula. En fee de lo qual di las presentes letras firmadas de mi nombre, y selladas con el sello menor de mi officio.

Fray Gabriel de S.
Ioseph Prouincial.

<ab xml:lang="es">YO <persName>FRAY Gabriel de Sancto Ioseph</persName>, Prior Prouincial desta Prouincia de Sanctiago de la Nueua España Ordinis Predicatorum. Auiendo visto el examen, y aprouacion del Vocabulario <lang>Misteco</lang>, hecho por los Padres de aquella nacion, aquienes por mi fue cometido. Y siendo vtil y prouechoso como con- sta por la dicha aprouacion, por la presente doy licencia al <persName>Padre Fray Francisco de Aluarado</persName>, Vicario de <placeName>Tamaçulapa</placeName>: para que pueda imprimir el dicho Vocabulario: con las censuras y notas de los dichos examinadores, juntamente con el Arte que de la dicha lengua <lang>Misteca</lang> compuso el Padre <persName>Fray Antonio de los Reyes</persName>, Vicario de <placeName>Tepusculula</placeName>. En fee de lo qual di las presentes letras firmadas de mi nombre, y selladas con el sello menor de mi officio.</ab>

<signed>
<persName>Fray Gabriel de S. Ioseph Prouincial.</persName>

<caption>Figure 27: Left a PDF version of part of the original prologue and right its TEI encoding</caption>

## 5.6 Etymology

In the Jansen & Perez Jiménez (2009) source there are roughly 70 instances which are labeled as being metaphorical in nature. These are labeled as follows:
yosa ndehe ichi: fenecer, acabar el que muere (por metáfora)

Figure 28: Entry for metaphorical term ‘yosa ndehe ichi’ as formatted in source PDF

Due to a lack of sufficient quantity for training, these items had to be manually identified
and annotated as follows:

<figure><img src="image_10.png" /><figcaption>Figure 29: TEI (partially enhanced) encoded entry for metaphorical term ‘yosa ndehe ichi’</figcaption></figure>

While at present not enough of the Classical Mixtec language yet to provide full analyses
of the majority of the instances of metaphor, this information is nonetheless encoded in
the TEI structure as per the recommendations of Bowers & Romary (2016), Bowers et
al. (2018). A partial structured analysis is provided for the phrase “yosa ndehe ichi” of
which only the portion *ichi* ‘path’ is discernable and which is represented as an etymon
within the <etym> block in TEI. At a later stage, researchers who are more familiar with
the language can enhance this content as needed.

6. Later steps

A logical and needed future endeavors would be to create a searchable TEI version of
the grammar of the language published in 1593 *Arte en Lengva Mixteca* by fray Antonio
de los Reyes. Given that this resource is a grammar and not a dictionary-like text, this
would not be a job for GROBID but another, general OCR tool. The text in the PDF
available is of low quality and it is likely that significant manual work would be necessary
to carry out.

Furthermore, according to Mesolore, much of the Alvarado Classical Mixtec vocabulary
was based on entries in the ‘Molina Vocabulario’ Castilian-Nahuatl dictionary (1571), a
Castillian-Zapotec dictionary compiled by Juan de Cordova in the Valley of Oaxaca (1578), and Antoni de Nebrija's Castillian-Latin Dictionarium (1553). Thus, many of these resources have common content and it would be a natural and beneficial next step to create TEI versions of these resources to expand all of the benefits described with regard to the current Classical Mixtec vocabulary to these other indigenous languages.

## 7. Conclusion

GROBID can handle the vast majority of the work needed to create a highly structured TEI dictionary from the PDF resource. However due to certain issues pertaining to the source document, its structure and the sample size of certain structures, in creating a maximally representative version of the content significant further manual and semi-manual work is required. Given the richness of the resource, to accurately carry out these enhancements it is essential that they are carried out by humans who understand the details only accessible through a detailed study.

Converting this resource into TEI brings the data into a highly structured extensible machine-readable format which can be systematically searched, extracted and exported into other data formats using simple XQuery and/or XSLT.

In creating this iteration of the historical resource, we have continued the work of previous endeavors (specifically Jansen & Perez Jiménez, 2009) who have worked to make this resource available to researchers and importantly to Mixtec communities. As this work was carried out in order to integrate the important resource to an ongoing linguistic and lexicographic project dealing with the Mixtepec-Mixtec variety, we hope to demonstrate how the Alvarado resource can be used as both an etymological and comparative cross-reference between different varieties of Mixtec as well as how TEI is a highly beneficial data format.

## References

* Alvarado, F. de. (1593). *Vocabulario en Lengua Mixteca. Hecho por los Padres de la Orden de Predicadores*. En México: Con Licencia, en casa de Pedro Balli.

* Bowers, J., & Romary, L. (2016). Deep Encoding of Etymological Information in TEI. *Journal of the Text Encoding Initiative*, (Issue 10).
https://doi.org/10.4000/jtei.1643

* Bowers, J., & Romary, L. (2017). Language Documentation and Standards in Digital Humanities: TEI and the Documentation of Mixtepec-Mixtec. In A. Kawase (Ed.), *Proceedings of the 7th Conference of Japanese Association for Digital Humanities* (pp. 21–23). Kyoto, Japan: Doshisha University.
Bowers, J., & Romary, L. (2018a). Bridging the gaps between digital humanities, lexicography and linguistics: a TEI dictionary for the documentation of Mixtepec-Mixtec. *Dictionaries: Journal of the Dictionary Society of North America*, 39(2).

Bowers, J., & Romary, L. (2018b). *Encoding Mixtepec-Mixtec Etymology in TEI*. Presented at the TEI Conference and Members, Tokyo, Japan.

Jansen, M. E. R. G. N., & Pérez Jiménez, G. A. (2009). *Voces del Dzaha Dzavui (mixteco clásico). Análisis y Conversión del Vocabulario de fray Francisco de Alvarado* (1593). *Colegio Superior Para La Educación Integral Intercultural de Oaxaca*.

Khemakhem, M., Foppiano, L., & Romary, L. (2017). Automatic extraction of TEI structures in digitized lexical resources using conditional random fields. *Proceedings of eLex 2017 conference*. Presented at Leiden, Netherlands. Leiden, Netherlands.

Khemakhem, M., Herold, A., & Romary, L. (2018 a). Enhancing Usability for Automatically Structuring Digitised Dictionaries. *GLOBALEX Workshop at LREC 2018*. Presented at Miyazaki, Japan. Retrieved from [hal-01708137v2](https://hal-01708137v2)

Khemakhem, M., Romary, L., Gabay, S., Bohbot, H., Frontini, F., & Luxardo, G. (2018 b). Automatically Encoding Encyclopedic-like Resources in TEI. In *The annual TEI Conference and Members Meeting*.

Khemakhem, M., Romary, L., Gabay, S., Bohbot, H., Frontini, F., & Luxardo, G. (2018 c). Automatically Encoding Encyclopedic-like Resources in TEI. In *The annual TEI Conference and Members Meeting*.

Lavergne, T., Cappé, O., and Yvon, F. (2010). Practical very large scale CRFs. In *Proceedings of the 48th Annual Meeting of the Association for Computational Linguistics*, pages 504–513. Association for Computational Linguistics

Maxwell, M., & Bills, A. (2017). Endangered data for endangered languages: Digitizing print dictionaries. *Proceedings of the 2nd Workshop on the Use of Computational Methods in the Study of Endangered Languages*, 85–91.

Mesolore. Accessed at: [http://www.mesolore.org/tutorials/learn/9/Introduction-to-the-Alvarado-Vocabulario](http://www.mesolore.org/tutorials/learn/9/Introduction-to-the-Alvarado-Vocabulario) (24 April 2019)
Proyecto de indicadores sociolingüísticos de las lenguas indígenas nacionales.
(2015). Accessed at:
http://site.inali.gob.mx/Micrositios/estadistica_basica/estadisticas
2015/estadisticas2015.html (5 July 2017)

Ranaivo-Malançon, B., Saee, S., Othman, R. M., & Busu, J. F. W. (2017). Transforming Semi-Structured Indigenous Dictionary into Machine-Readable Dictionary. *Journal of Telecommunication, Electronic and Computer Engineering (JTEC)*, 9(3–11), 7–11.

Reyes, A. de los. (1593). *ARTE EN LENGVA MIXTECA COMPUESTA*. Accessed at: https://books.google.at/books?hl=en&lr=&id=Vbh9oGk-YKwC&oi=fnd&pg=PA4&dq=%22Arte+en+Lengua+Mixteca%22+Antonio+de+lo+s+Reyes&ots=yPfYu574TP&sig=S3ro_9u4ZAp1-7wGnPVoA4WPS4U (15 April 2019)