Edit model card

Model Card for modernisa-byt5-base

This model translates from historical, non-normalized Spanish with historical orthography to modern normalized Spanish. It is a fine-tuned version of the multilingual version of the text-totext transformer ByT5 (Xue et al, 2021, 2022) fro translation from 17th century Spanish to modern Spanish.

Model Details

Model Description

This model translates from historical, non-normalized Spanish with historical orthography to modern normalized Spanish. It is a fine-tuned version of the multilingual version of the text-to-text transformer ByT5 (Xue et al, 2021, 2022) for translation from 17th century Spanish to modern Spanish. A fine-tuned version of google/byt5-base trained on a parallel corpus of 44 Spanish-language Golden Age dramas.

Uses

The motivation to develop the model was to provide a tool producing normalized text which enables computational analyses (such as distances between texts, clustering, topic modeling, sentiment analysis, stylometry etc.), to facilitate modern editions of historical texts and thus alleviate a job which been done manually so far and to provide a resource which may be used by historians and editors who manually transcribe texts produced in the 17th century which were not yet digitized, which are available in cultural heritage institutions, especially libraries and archives. While all the dramas used are written in verses, the model was not tested on texts in prose; the quality of the translation of prose texts into modern normalized Spanish might therefore differ significantly from the satisfying results achieved with dramas in verses.

Direct Use

This resource may be used by historians and editors who manually transcribe texts produced in the 17th century which were not yet digitized and which are typically available in cultural heritage institutions, especially libraries and archives.

Downstream Use [Optional]

This model is already fine-tuned.

Out-of-Scope Use

Bias, Risks, and Limitations

It has to be underlined that the parallel corpus was created solely from text written by four men who lived in counter-reformatory Spain during the rule of inquisition. The view of the world of these dramatists is from our contemporary point of view outdated, strongly patriarchal, misogynist and discriminatory with respect to non-catholic human beings.

Recommendations

The intended users of this model are researchers and editors of historical texts. We cannot imagine any harm done by the modernization of those texts as a technical process; however, the reading of such texts may be harmful for persons who are not acquainted with the worldview produced in 17th century Spain. Moreover, linguistic change provides a strong challenge to Natural Language Processing (NLP) applications. Vis-à-vis other languages, linguistic change within the Spanish language was not very pronounced. Further research on the modernization of historical languages is therefore strongly recommended.

Training Details

Training Data

We built a parallel corpus of Spanish Golden Age theater texts with pairs of 44 Golden Age dramas in historical orthography and current orthography. Both corpora were aligned line by line to establish a ground truth for the translation between the different historical varieties of Spanish. The 44 dramas have been written by Juan Ruiz de Alarcón (5), Pedro Calderón de la Barca (28), Félix Lope de Vega Carpio (6), and Juan Pérez de Montalbán (5). The dataset is available on Huggingface.

Training Procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 0.0001
  • train_batch_size: 4
  • eval_batch_size: 4
  • seed: 42
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • lr_scheduler_type: linear
  • num_epochs: 3

Training results

Training Loss Epoch Step Validation Loss Bleu Gen Len
0.1474 0.35 10000 0.1360 42.8789 18.4441
0.1328 0.71 20000 0.1303 43.5394 18.4368
0.1216 1.06 30000 0.1245 44.1557 18.4384
0.1167 1.42 40000 0.1219 44.1961 18.4449
0.1065 1.77 50000 0.1192 44.7353 18.443
0.099 2.13 60000 0.1195 44.522 18.4524
0.088 2.48 70000 0.1192 44.8243 18.4441
0.0907 2.84 80000 0.1176 44.888 18.4465

Framework versions

  • Transformers 4.13.0.dev0
  • Pytorch 1.10.0+cu111
  • Datasets 1.15.2.dev0
  • Tokenizers 0.10.3

Preprocessing

Speeds, Sizes, Times

After randomizing all 141,023 lines in the corpus, we split it into training (80%), validation (10%) and test (10%) sets stratifying by play. We then fine-tuned T5 and ByT5 base models on sequence lengths of 256 doing a grid search for 3 and 5 epochs, weight decay 0 and 0.01, learning rates of 0.001 and 0.0001, and with and without a “translate” prompt.

Evaluation

Testing Data, Factors & Metrics

Testing Data

A single drama by Lope de Vega (Castelvines y Monteses, 1647).

Factors

More information needed

Metrics

More information needed

Results

BLEU: 80.66 CER: 4.20%

Model Examination

More information needed

Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

  • Hardware Type: More information needed
  • Hours used: More information needed
  • Cloud Provider: More information needed
  • Compute Region: More information needed
  • Carbon Emitted: More information needed

Technical Specifications [optional]

Model Architecture and Objective

More information needed

Compute Infrastructure

More information needed

Hardware

More information needed

Software

More information needed

Citation

BibTeX:

@inproceedings{de_la_rosa_modernilproject_2022,
    address = {Tokyo},
    title = {The {Moderniſa} {Project}: {Orthographic} {Modernization} of {Spanish} {Golden} {Age} {Dramas} with {Language} {Models}},
    shorttitle = {The {Moderniſa} {Project}},
    url = {https://dh2022.dhii.asia/abstracts/files/DE_LA_ROSA_Javier_The_Moderni_a_Project__Orthographic_Modern.html},
    language = {en},
    publisher = {Alliance of Digital Humanities Organizations ADHO / The University of Tokyo, Japan},
    author = {De la Rosa, Javier and Cuéllar, Álvaro and Lehmann, Jörg},
    month = jul,
    year = {2022},
}

APA:

De la Rosa, J., Cuéllar, Á., & Lehmann, J. (2022, July). The Moderniſa Project: Orthographic Modernization of Spanish Golden Age Dramas with Language Models. Retrieved from https://dh2022.dhii.asia/abstracts/files/DE_LA_ROSA_Javier_The_Moderni_a_Project__Orthographic_Modern.html

MLA:

De la Rosa, Javier, et al. The Moderniſa Project: Orthographic Modernization of Spanish Golden Age Dramas with Language Models. Alliance of Digital Humanities Organizations ADHO / The University of Tokyo, Japan, 2022, https://dh2022.dhii.asia/abstracts/files/DE_LA_ROSA_Javier_The_Moderni_a_Project__Orthographic_Modern.html.

Glossary [optional]

More information needed

More Information [optional]

More information needed

Model Card Authors [optional]

Javier de la Rosa, Jörg Lehmann, questions and comments about the model card can be directed to Jörg Lehmann at joerg.lehmann@sbb.spk-berlin.de

Model Card Contact

Jörg Lehmann

How to Get Started with the Model

Use the code below to get started with the model.

Click to expand

More information needed

Downloads last month
10
Safetensors
Model size
582M params
Tensor type
F32
·

Dataset used to train modernisa/modernisa-byt5-base

Space using modernisa/modernisa-byt5-base 1