Elamur Research

Restoring ancient text using deep learning: a case study on Greek epigraphy

Paper · 2019 · Yannis Assael, Thea Sommerschield and Jonathan Prag

Summary

A damaged inscription can preserve enough of a sentence to suggest what belongs in a gap, while leaving several readings open. Filling that gap matters because inscriptions provide direct evidence about the people and institutions that produced them. The authors introduce PYTHIA, a system that takes a transcription with a marked gap and ranks possible completions. Its task begins after someone has transcribed the surviving text and specified how many characters to restore. It draws on what survives before and after the gap, using whole words where they can be recognized and individual letters where only fragments remain. The case study is in Ancient Greek.

The authors built the training and evaluation corpus, PHI-ML, from the Packard Humanities Institute’s collection of Greek inscriptions. Printed conventions for expressing damage, uncertainty, and other editorial information had to be made consistent enough for a program to process. Even after that work, genuinely lost letters could supply no verified answers. The authors therefore hid passages whose contents were available in the corpus. This gave them damaged-looking inputs with known targets and let them measure how accurately PYTHIA could recover precisely the characters they had hidden.

On PHI-ML, the strongest version of PYTHIA recorded a character error rate of 30.1% for its top suggestion. The two doctoral students with epigraphic expertise recorded 57.3% in the timed human comparison. The hidden sequence appeared among PYTHIA’s Top-20 suggestions in 73.5% of cases. The architecture comparisons show that reading the context in both directions improved the results over the version that read it in one direction. Adding whole-word information to the bidirectional version improved both reported measures further. A separate test that varied the amount of surrounding text found that the shortlist benefited from longer context, with performance peaking around 500 characters.

The shortlist is central to the intended use. For a scholar, a plausible candidate can be worth examining even when the system gives another candidate first place. The paper illustrates this use by comparing iterative completions of a damaged inscription with a published edition. The quantitative test measures recovery of characters the authors deliberately hid, while the inscription example shows what reviewing suggestions could look like when the original wording is uncertain. The authors released PYTHIA and the PHI-ML processing pipeline to support further work on both sides of that distinction.

Deep dive: Restoring ancient text using deep learning: a case study on Greek epigraphy

PYTHIA proposes missing letters in ancient Greek inscriptions using nearby text, and PHI-ML tests how often its first guess or shortlist is right. · about 32 minutes to read

The problem and its context

From a surviving inscription to a proposed reading

Epigraphy studies texts written on durable materials such as stone, ceramic, and metal. The surfaces can outlast the societies that made them, but much of the writing reaches readers in damaged form. An inscription may preserve the end of a name or a stretch of a clause while losing the letters that tell a historian who is involved or how the clause fits into the rest of the document. The surviving words are evidence in their own right. The restorations proposed for the gaps affect how far that evidence can be interpreted.

An epigraphist faced with a gap has to make judgments about its size as well as its wording. The reconstructed layout can indicate how much room there was on a line. Grammar and syntax can narrow down which expressions would fit there. A surviving ending, for example, can help constrain the kind of word that might precede it. These clues interact. A reading can make sense grammatically and still be difficult to fit into the available space. A string of the right length can fit the space while making poor sense in the passage.

The task PYTHIA addresses starts after some of those judgments have already been made. It receives a sequence of text, together with explicit positions to complete. That formulation gives the software access to the readable wording and the length assigned to the gap. The physical evidence informs the transcription and the length estimate through the scholar who prepares them. This makes the problem tractable as a textual prediction task while preserving a clear role for the evidence that has to be examined outside the transcription.

Why finding parallels takes work

The paper describes restoration as a search for parallels. A parallel can be a recurring expression or a comparable passage in a document whose circumstances make it relevant. A scholar can use familiarity with the record to recall a likely formula, or search a digital corpus for surviving words and fragments. A parallel helps when it supplies a possible continuation and gives the scholar a document against which to judge that continuation. Deciding whether the documents are comparable is part of the reasoning.

The difficulty with string matching is that it starts from the wording the researcher thought to enter. A small change in the query can change which documents come back. When only part of a word survives, the researcher may have to guess how to write the query before the search can supply evidence for the guess. A query can also focus on a local fragment while leaving out another part of the inscription that would help distinguish between completions. The authors identify this dependence on the query as an obstacle to assessing the range and relative plausibility of restorations.

PYTHIA changes where that work begins. A researcher can present the marked passage and receive a ranked set of candidate strings without writing a separate search query for each possible completion. A suggested string may reflect patterns learned across inscriptions and clues within the current passage. A parallel found by a scholar still has a property of its own: it can be inspected as a particular document. The system’s ranking supplies a different kind of evidence, grounded in what its training and textual input make it favor.

The authors place restoration alongside familiar problems in natural language processing. A count-based predictor can estimate which continuations are likely by counting how often short sequences recur. In that respect, it resembles a search for recurring expressions. Both approaches draw strength from repeated wording, although a count summarizes occurrences while a corpus search returns passages for inspection. The paper connects this kind of predictor to the n-gram.

The paper describes earlier neural approaches that predict text using words, smaller units, or individual characters. The choice matters for inscriptions. A recognized word carries information about a larger unit of the sentence in a compact form. A partially preserved word can still carry useful information in its surviving letters, even if the whole string has no entry in a vocabulary. The character-aware work the paper cites offers a precedent for drawing on both kinds of information. Character-Aware Neural Language Models

The authors also connect their task to machine reading comprehension and to cloze tests, in which part of a passage is withheld and a reader tries to supply it. Those tasks share the idea of extracting evidence from a passage to answer a question about it. The epigraphic version has a particular constraint: the blank may fall inside a word or span portions of adjacent words, and the requested answer consists of characters. The context can itself contain damage. A method that assumes a complete sequence of recognizable words would lose part of the evidence before prediction began. Teaching Machines to Read and Comprehend

Earlier computational work on inscriptions, as the paper presents it, addressed several neighboring problems. Some projects assisted human readers, while others worked on recognizing visual signs or identifying writers. There was also work on textual analysis and translation. These efforts act on different parts of the scholarly process. Recognizing a mark involves evidence still present on a surface. Supplying a lost letter requires inferring what could have occupied a position where that visual evidence has disappeared. PYTHIA’s contribution concerns the latter problem as it appears in already transcribed text.

The authors chose Greek epigraphy because the record contains varied kinds of writing and because a large digitized collection was available. Literary Greek collections also existed, giving them sources of additional text and a way to ask how much it matters that the training material resembles the inscriptions under study. The inscriptions considered extend from the 7th century BCE to the 5th century CE. A corpus spanning different times and contexts gives the restoration system a substantial range of material to learn from, while making the match between its training examples and any individual passage a question worth examining.

The method, step by step

Turning edited inscriptions into PHI-ML

The starting material was the Packard Humanities Institute’s PHI corpus. An edition communicates with a human reader through conventions that can be difficult to interpret consistently in software. An editor may use symbols to distinguish types of damage, embed a comment in the transcription, or report an estimated gap length without spelling it out as a row of empty positions. The authors wanted input in which the same kind of character had the same role throughout the corpus. They first had to decide which features to retain and which to normalize.

They began by examining character frequencies and standardizing the Greek alphabet used in the data. That stage identified 147 core characters, including accented forms, and accounted for numerals, spaces, and punctuation. The edited transcriptions already reflected scholarly conventions such as lowercasing and adding accents and punctuation. The corpus pipeline worked on those transcriptions. Its character inventory was therefore a choice about representing edited text, including distinctions an editor can make even where they are generally absent from the original surface.

Regular expressions handled recurring editorial patterns. The authors replaced Greek numerical notation with 0 to avoid letting numerical correlations drive prediction. They stripped remaining punctuation marks targeted by the cleaning procedure, removed conventional signs that surrounded certain letters, cleared human comments, and discarded notes whose contents were outside Greek. They also corrected spacing and cases of repeated punctuation before filtering the result to the allowed inventory. These steps made the material more consistent, while leaving the textual characters PYTHIA would use as evidence.

Texts with fewer than 100 characters were discarded. For a gap whose length an editor had estimated, the authors expanded the estimate into the corresponding number of hyphens. The length then occupied positions within the character sequence. This was important for distinguishing a known unknown from an omitted annotation. A run of hyphens tells PYTHIA that some characters are already missing from its context. It also preserves the place those characters would occupy in the edited representation.

PYTHIA uses a question mark for a position it has been asked to predict. A passage can therefore contain hyphens and question marks at once. During training and quantitative evaluation, a question mark replaces a character available to the experimenter as a target. The network receives the marker but cannot see the character beneath it. A hyphen represents an existing gap whose contents are unavailable for that comparison. The distinction lets the authors make prediction exercises from partially damaged inscriptions without treating every damaged position as a question with a known answer.

The processed corpus is PHI-ML. The authors split it by inscription identifier before making training and evaluation examples. Identifiers ending in 3 went to the test set, and those ending in 4 went to validation. The rest supplied training material. Because the split was at inscription level, a window drawn from a test inscription would come from a different inscription than any window drawn for training. Recurring phrases across different inscriptions can still be learned and reused, which is part of the textual evidence the approach is designed to exploit.

Accentuation was retained in the character inventory during corpus construction, then discarded for the reported comparisons. Entering accents would have added work to the human exercise. For that comparison, the authors judged predictions after setting aside those distinctions and report that the choice made no noticeable difference to the scores. The corpus preparation and the scoring convention answer separate questions: which characters the standardized material can represent, and which distinctions count in the reported task.

Making a gap with an answer

The authors needed a source of examples in which they could know what belonged at the marked positions. A genuinely lost passage could be turned into a request for suggestions, but agreement with an editor’s best guess would be difficult to interpret as a test of historical accuracy. The training procedure instead takes a passage available in PHI-ML, makes part of it temporarily invisible to the system, and asks the system to recover it. The withheld portion is the reference answer for that exercise.

At each training step, the authors select an inscription and sample a starting position and a length for the surrounding passage. They call the resulting context text x. The range they give for the sampled context length can be written as follows.

length(x) ∈ [100, 1000]

x denotes the selected context sequence. length(x) is its length in characters. The symbol ∈ means that the value belongs to the indicated interval. The square brackets make 100 and 1000 the included lower and upper bounds, respectively. The starting position locates the passage within the inscription. The interval specifies the length of the passage drawn from that position.

The authors then sample a starting position inside that context and a length for the target. This gives one contiguous span, which they call y. They keep its characters as the answer and replace their positions in x with question marks.

length(y) ∈ [1, 10]

y denotes the target character sequence before it is hidden. length(y) counts the characters in that sequence. The membership sign ∈ again places the length in an interval, and the square brackets include both endpoints. Here 1 is the minimum target length and 10 is the maximum. Because each hidden character is replaced by its own marker, the input reveals the target length while withholding the target letters.

Changing the sampled passage and target lets the same underlying kind of inscription yield different prediction problems. In one example, a blank may remove enough letters to make a word unrecognizable. In another, the blank may be surrounded by intact words. Both are handled with the same input notation. The validation and test sets use the maximum context length specified for the experimental setup. The paper’s separate analysis of context length then asks what happens when the system receives less surrounding text.

This sampling procedure fixes an important part of the difficulty. PYTHIA has to decide what goes into a span of known length at a known location. It learns from an answer visible to the training procedure even though the answer is absent from the input. The same representation can be used to request hypotheses for a real gap, provided a length is supplied. In that setting, the question marks still define the requested positions, but the answer retained during artificial masking has no counterpart unless a reference reading is chosen.

Reading letters and words together

PYTHIA uses a sequence-to-sequence architecture. Here the input sequence is the context, with its surviving letters and gap markers. The output sequence consists of the letters chosen for the marked target. The output can be much shorter than the input because the network’s job is to fill the requested passage, leaving the surviving text available as evidence. The design borrows the encoder-and-decoder organization associated with Sequence to Sequence Learning with Neural Networks.

An encoder builds a representation of the input. The first operation is a lookup: each input character has a learned vector, which is a list of numerical values used to represent that character within the network. Every occurrence of a particular character starts from the same lookup entry. Its surroundings then affect the representation built by the encoder. The paper adds a separate lookup for words, giving the strongest version of the system two sources of information to process at each character position. These learned numerical representations are word embeddings.

For that word lookup, the authors collected the 100k most frequent words in PHI-ML. At a character position, the encoder receives the vector for the current character and the vector for the word containing it. The system joins the vectors into a single input at that position. Thus the word information repeats across the positions belonging to the same word, while the character information changes as the encoder advances. Intact words can provide a broader signal about the passage without removing the letter-by-letter evidence.

A word missing from the vocabulary is assigned the shared unk vector. A word containing missing letters is treated the same way at the word level. The character representation is still available for the letters that survive within that word. This is the reason the two streams are especially useful together around a gap. The system can use the intact neighboring words as recognizable units and keep the visible prefix or suffix of a damaged word as character-level evidence.

The paper illustrates the setup with a short Delphic maxim commonly rendered as “nothing to excess.” The input shows μηδέν followed by ἄ??ν. The second word has a surviving beginning and ending, yet the word lookup sees an incomplete form and uses unk. The character stream still contains the surviving letters and both question marks. The decoder supplies γα for the blank. The illustration shows how the architecture can finish a word even when the word stream contributes no specific vocabulary entry for that word.

The encoder and decoder are built with long short-term memory networks, abbreviated LSTMs. An LSTM processes a sequence using a state carried from one position to the next. The state lets evidence from earlier positions affect later computations, and the architecture is designed to retain information across longer stretches of input. In PYTHIA’s preferred version, the encoder reads in both directions. An encoded position can therefore reflect evidence from earlier and later characters in the original inscription. The decoder produces the missing span as a sequence of characters.

The bidirectional encoder is a good fit for a located gap. A clue after the blank is already available when the system receives the passage, just as a clue before it is. Both can constrain what fits at the blank. Bidirectionality gives each encoded position access to information carried through both reading directions. The decoder can then draw on those representations as it predicts the output. This design is distinct from the separate question of how the decoder chooses which encoded positions matter for a particular letter.

From encoded context to a ranked shortlist

Attention supplies that choice. At a decoding step, it gives the network a way to draw more strongly on some encoded input positions than on others. The relevant evidence can change as the system moves through the target. For a fragment of a name, different letters in the output may depend on different parts of an occurrence elsewhere in the input. A separate example in the paper examines the weights assigned during just such a restoration. The architecture draws on earlier attention work developed for neural machine translation.

Training teaches the decoder to predict the characters hidden during masking. At prediction time, the system has to turn its preferences at successive steps into whole candidate strings. Fixing each character as soon as it receives the highest score could discard another partial string that would have led to a stronger completion. Beam search retains multiple partial sequences, extends them as decoding proceeds, and limits the number kept at each stage. The evaluation used a beam width of 100.

The returned shortlist is smaller than that search width. PYTHIA reports its Top 20 predictions along with a confidence value for each result. The output is therefore suited to a review task in which a scholar can inspect several strings of the required length. The confidence values give an ordering for that review. The paper’s evaluation of the shortlist asks whether the exact reference occurs among the returned predictions. It does not estimate how frequently a particular numerical confidence corresponds to a confirmed reading.

How PYTHIA learns and proposes restorations

The steps in order.

How PYTHIA learns and proposes restorationsStep 1: Standardize the edited inscription text1. Standardize the edited inscription textStep 2: Sample context and mark a target span2. Sample context and mark a target spanStep 3: Look up character and word embeddings3. Look up character and word embeddingsStep 4: Encode context in both directions4. Encode context in both directionsStep 5: Attend to relevant positions while decoding5. Attend to relevant positions while decodingStep 6: Rank candidate sequences with beam search6. Rank candidate sequences with beam searchStep 7: Return a shortlist of possible restorations7. Return a shortlist of possible restorations

The names PYTHIA and PHI-ML identify different parts of the contribution. PYTHIA is the restoration system, with variants for testing the effects of reading direction and word information. PHI-ML is the processed inscription corpus that makes the prediction exercise possible. The authors made PYTHIA and the PHI-ML processing pipeline openly available. Reproducing the task depends on the corpus decisions as well as the network, since the notation for damage, the split by inscription, and the procedure for hiding text determine what evidence the system receives.

Experiments and results

The held-out material

The corpus contains more than 3.2 million words. The paper reports 34, 952 inscriptions in the training split, 2, 826 in validation, and 2, 949 in test. In words, the corresponding split sizes are 2, 792k, 211k, and 223k. At character level they are 16, 300k, 1, 230k, and 1, 298k. These are corpus statistics. The restoration exercise is defined by sampling passages and target spans from that material, so the counts of inscriptions, words, and characters describe the source available to the procedure.

The evaluation uses the characters deliberately hidden from the passage as the reference. That choice lets each system face a task with an exact answer under common input conventions. The reference might lie within a word rather than coincide with an intact word boundary. A match is judged at the level of the hidden sequence. The comparison can therefore include examples for which a word vocabulary would have little to say about the central damaged form even though the surrounding passage contains informative whole words.

Who and what took the test

The human comparison involved two doctoral students with epigraphic expertise. They could consult the training corpus for parallels, and they completed an average of 50 restorations in two hours. The reported result is for their restorations under that arrangement. The human exercise included access to written evidence beyond what a person could recall unaided, while the time and response format bounded how much searching and reconsideration could go into the submitted readings.

The authors also evaluated a character-level language model, meaning a predictor trained on sequences of characters. They chose that granularity because the damaged input often prevents recognition of whole words. The setup followed the recurrent approach the paper attributes to earlier work on recurrent neural network regularization.

The language-model baseline was trained with different collections. LM Philology used the literary collections First1KGreek and Perseus. LM Philology & Epigraphy added PHI-ML to those collections. LM Epigraphy used PHI-ML as its training source. All were evaluated on the PHI-ML restoration problem. This set of comparisons asks whether the baseline benefits from additional Greek writing in general, or whether the kind of Greek writing available during training matters for predicting inscriptions.

The PYTHIA variants changed the evidence available to the encoder. PYTHIA-Uni took characters and read the input in one direction. PYTHIA-Bi still took only characters but read in both directions. PYTHIA-Bi-Word kept the bidirectional encoder and supplied the word vector alongside the character vector at each position. The names describe concrete changes in the input and how it is processed, so the scores can be read as comparisons between particular design choices within the system.

Two ways to read the predictions

The paper reports character error rate, abbreviated CER, for the top prediction against the reference. A lower value means that the highest-ranked suggestion is closer to the hidden sequence at character level. The measure can distinguish a suggestion that recovers much of the span from one that recovers little of it. It concerns the quality of the first returned reading, which matters when evaluating the ranking or using the first candidate as the system’s proposed answer.

Top-20 accuracy asks a different question. A case counts as successful when the entire reference sequence appears somewhere among the first 20 suggestions. A reference near the end of that list counts in the same way as a reference at the top. The measure therefore captures the coverage of a shortlist of a fixed size. It gives no partial credit for a list containing several close readings, and it does not measure whether a person can recognize the reference after looking through the suggestions.

Top prediction character error rate on the PHI-ML restoration task

PYTHIA with bidirectional encoding and word input has the lowest character error rate in the comparison.

Top prediction character error rate on the PHI-ML restoration taskAncient Historian: 57.3%Ancient Historian57.3%LM Philology: 68.1%LM Philology68.1%LM Philology & Epigraphy: 65.0%LM Philology & Epigraphy65.0%LM Epigraphy: 52.7%LM Epigraphy52.7%PYTHIA-Uni: 42.2%PYTHIA-Uni42.2%PYTHIA-Bi: 32.5%PYTHIA-Bi32.5%PYTHIA-Bi-Word (this paper): 30.1%PYTHIA-Bi-Word (this paper)30.1%
The numbers
System or settingcharacter error rate %
Ancient Historian57.3%
LM Philology68.1%
LM Philology & Epigraphy65.0%
LM Epigraphy52.7%
PYTHIA-Uni42.2%
PYTHIA-Bi32.5%
PYTHIA-Bi-Word (this paper)30.1%

The human CER was 57.3%. For the epigraphy-only language model, the paper’s results table gives 52.7%, while the surrounding prose assigns it 57.3%. The chart follows the table, which also gives the shortlist result for that system and identifies the scores for the other training collections. The discrepancy matters to the numerical comparison with the human result. Either reading leaves the epigraphy-only baseline ahead of the baselines trained with literary material and behind the PYTHIA variants on this measure.

The literary-only baseline recorded 68.1% CER, and the baseline combining literary and epigraphic material recorded 65.0%. Among the PYTHIA variants, the lowest CER was 30.1% for PYTHIA-Bi-Word. This is the result for the top prediction under the PHI-ML evaluation conventions. It measures the distance from the known hidden text, including cases where the top prediction is partly correct. It should be read alongside shortlist coverage when the intended use involves presenting several readings for inspection.

Top-20 exact restoration accuracy on the PHI-ML task

The bidirectional PYTHIA variant with word input recovers the reference in its shortlist most often.

Top-20 exact restoration accuracy on the PHI-ML taskLM Philology: 26.0%LM Philology26.0%LM Philology & Epigraphy: 28.8%LM Philology & Epigraphy28.8%LM Epigraphy: 47.0%LM Epigraphy47.0%PYTHIA-Uni: 60.6%PYTHIA-Uni60.6%PYTHIA-Bi: 71.1%PYTHIA-Bi71.1%PYTHIA-Bi-Word (this paper): 73.5%PYTHIA-Bi-Word (this paper)73.5%
The numbers
System or settingTop-20 accuracy %
LM Philology26.0%
LM Philology & Epigraphy28.8%
LM Epigraphy47.0%
PYTHIA-Uni60.6%
PYTHIA-Bi71.1%
PYTHIA-Bi-Word (this paper)73.5%

There is no human Top-20 entry in the results table. The reported human exercise provides a CER for submitted restorations, and the shortlist comparison covers the automated systems. PYTHIA-Bi-Word found the complete reference among its returned candidates in 73.5% of cases. That outcome supports the proposed use of the shortlist: the reference sometimes survives the search even when another reading receives the highest score. A scholar who considers several candidates can make use of coverage that a first-choice evaluation leaves out.

The two charts also show a consistent ordering among the automated systems. The stronger systems on character error for their first suggestion are also the stronger ones on exact reference coverage in their shortlists. That agreement matters because either metric could have favored a different setting. A predictor might put broadly plausible partial matches first while failing to generate the full answer, or it might cover the answer in its shortlist while ranking other strings first. Within these comparisons, the preferred architecture improves both aspects of the result.

An application to a complete inscription

The paper also examines an inscription with genuinely damaged text. It applies PYTHIA iteratively to the missing portions of IG II 2,116, lines 34–48, and compares the resulting readings with a published edition. The figure distinguishes places where the generated text agrees with the edition from places where it differs. Viewing them in the passage lets a reader see how a series of local completions contributes to an extended reading and how errors can remain within an otherwise plausible piece of text.

The authors report that the reference sequence occurred in the Top-20 suggestions in almost all the cases in that example. They give no exact rate for it. The comparison illustrates the potential value of reviewing alternatives across a whole inscription. It also has a different evidential status from the masked-text experiment. Here the edition is the reference against which the proposed readings are compared. In the quantitative task, the reference is the sequence made invisible for the exercise and retained for scoring.

What the ablations show

Reading from both sides of the gap

The contrast between PYTHIA-Uni and PYTHIA-Bi is the main test of reading direction. Both variants encode the input at character level. Moving from a unidirectional to a bidirectional LSTM changes how the encoder can propagate information from different parts of the inscription. CER on PHI-ML falls from 42.2% to 32.5%, while Top-20 accuracy rises from 60.6% to 71.1%. Of the feature comparisons within PYTHIA, this is the larger movement on both reported measures.

A gap makes the reason for examining direction especially plain. If the system is trying to restore letters within a word, later surviving letters may constrain the possibilities. Farther away, material after the gap may reveal what kind of expression fits there. The unidirectional encoder builds its position representations in a single order, while the bidirectional one computes states traveling in both orders. These results show the benefit of that change in the encoder. The experiment does not partition the gain into how much came from adjacent characters, nearby words, or more distant parts of the same passage.

It is also important to distinguish reading direction from context length. Bidirectionality changes how the system represents the text it has been given. The context-length test changes the amount of text it has available in the first place. A short passage can be read in both directions and still contain little evidence. A long passage can preserve a relevant clue far from the target, provided the network can carry that information into the decoding process. The paper investigates both conditions through separate comparisons.

Adding intact words to the character stream

PYTHIA-Bi-Word is compared directly with PYTHIA-Bi. Both use bidirectional encoding, while the preferred version adds word embeddings at the character positions. CER moves from 32.5% to 30.1%, and Top-20 accuracy from 71.1% to 73.5%. The comparison supports the claim that word-level information adds something beyond a bidirectional reading of the letters. It was tested as a supplement to the character stream, in which every surviving letter remains available.

Because damaged or unlisted words receive unk, the extra information has a particular distribution. A missing span often deprives the word stream of a recognizable form at the center of the problem. Intact words nearby can still contribute their specific representations. From the aggregate scores, the gain could come from better use of evidence near the gap or elsewhere in the passage. The experiment does not identify which kinds of words or gaps account for most of the benefit. It establishes that the combination helps across the test used for the reported scores.

The result also clarifies what it means to say that PYTHIA works at word and character level. It predicts characters, and word information enters on the input side. A candidate can contain a character sequence the system has assembled through decoding. The word vocabulary helps represent surviving text without defining a list of all permitted restorations. That division of labor is central to a task in which the units the system can recognize in the context can differ from the units it is asked to produce.

How the training collection affects the baseline

The three language-model baselines vary the training material. The epigraphy-only baseline reaches 47.0% Top-20 accuracy on PHI-ML, compared with 26.0% for the literary-only baseline and 28.8% for the combined baseline. The character error figures in the results table show the same ordering. Under this baseline setup, the training material closest to the target collection gives the strongest performance, and adding literary material does not improve the epigraphy-only result.

The authors suggest that literary and epigraphic Greek reflect different textual cultures. That interpretation fits a task built around recurring expressions: a body of writing can share the language of the target documents while differing in the expressions most useful for restoring them. The benchmark comparison varies the collections as used in the experiment. It leaves open how much of the result is due to differences in style and content, and how much might depend on the way the mixed training material was presented to the predictor. No other mixing procedure was evaluated in that comparison.

This is a comparison of training collections for the language-model baseline. The PYTHIA ablations change a different part of the setup, namely the architecture and its input representations. Taken together, they suggest why it is worth paying attention to both the source of the learned patterns and how the network uses context. The baseline evidence about literary data applies to the training conditions under which those versions were evaluated.

How much context helps

The authors vary the length of the surrounding passage given to PYTHIA-Bi-Word and measure Top-20 accuracy. The plot shows an overall positive relationship between available context and the chance that the reference appears in the shortlist, with a peak around 500 characters. A context of 20 characters illustrates how much harder the prediction can be with very little surrounding text. The plot is a test of shortlist coverage under different amounts of input, while the main evaluation uses the maximum context length for its validation and test passages.

A short window may contain enough of a word to constrain its spelling while omitting the part of the inscription that makes one possible word more plausible than another. A longer window can bring in a repeated expression or a name elsewhere in the passage. It can also contain letters that add little for the particular gap. The reported peak describes the aggregate experiment, in which different target spans can benefit from different clues. It supplies no universal optimum for the context length of any single restoration.

The paper connects limited context to the difficulty of searching for parallels with a short string. Both cases can offer too little evidence to distinguish alternatives, but their mechanics differ. When PYTHIA receives more text, the encoder and attention mechanism can use positions that were absent from the shorter input. When a scholar searches with a longer query, the search conditions change. The context experiment directly measures the first mechanism and helps explain why the authors designed PYTHIA to accept an extended passage around the gap.

Seeing a repeated name influence a prediction

The attention example asks whether a particular piece of available context can influence a particular prediction. The authors modify a passage so that a personal name at its end retains the ending -ου but hides its first 9 characters. The chosen name, ἀπολλοδώρου, already occurs earlier in the supplied text. That repeated occurrence provides a candidate for the same name at the blank. The hidden portion of the chosen name is the target.

y = ἀπολλοδώρ

y is the hidden character sequence in this worked example. The equals sign identifies its contents. The Greek letters on the right are the missing part of the name. The surviving ending remains in the input and is outside the target the decoder has been asked to supply.

The authors show the attention weights while the decoder produces the first 4 missing characters. For visibility, they scale the weights between 0 and 1 separately within the marked gap and within the rest of the text. Color intensity then indicates differences within each of those regions. The display helps locate the emphasized positions in the surrounding text, including the earlier occurrence of the name. Because each region has its own scaling, the colors alone cannot be used to compare absolute attention weights between the two regions.

The authors then change the earlier occurrence to ἀρτεμιδώρου, a different personal name of the same length. The prediction for the gap changes to ἀρτεμιδώρ. That intervention makes the example more informative than a picture of weights alone. The visible ending and the size of the gap still permit the new reading, and altering the earlier name changes which missing sequence the system supplies. The controlled substitution ties the change in output to a change in relevant input in this passage.

The experiment illustrates a behavior that an epigraphist could recognize as relevant: a repeated name can supply a plausible reading of a damaged occurrence elsewhere in the inscription. It is a particularly clear case because the evidence and the predicted string can be compared directly. The result is evidence about the behavior of PYTHIA on that passage. Establishing how often the same mechanism explains predictions across PHI-ML would require a broader set of interventions, including cases where no duplicate of the target occurs in the input.

Limitations

Limits the authors identify

The authors’ central evaluation constraint is the loss of the original text. A genuinely missing sequence usually cannot supply the verified answer needed to score a restoration. Artificial masking solves that practical problem by giving the evaluator a reference for every tested span. The resulting numbers quantify recovery of text represented in PHI-ML under the imposed conditions. In the full-inscription demonstration, agreement is instead judged against the published edition the authors selected.

The authors also describe the time and effort required for human restoration. For their comparison, they use the work of two trainee specialists who have access to parallels from the corpus and average 50 restorations over two hours. For ease of participation, the authors removed accent distinctions from the evaluation and report that doing so did not noticeably affect the scores. Any reading that depends on resolving accentuation would call for evidence outside this particular comparison, even though the standardized corpus retained accented forms during preparation.

Computing resources also limited the comparison. The authors attempted to include BERT and report that the resource demands exceeded what they could train on a single GPU. The paper therefore supplies no measured comparison between PYTHIA and BERT. The result establishes how PYTHIA performed against the systems and people included in the study. BERT

The authors propose wider use in fields that work with ancient texts and suggest that the approach can apply to other languages. Their empirical case is Greek epigraphy. The architecture explains why that wider ambition is plausible: a character sequence, a gap marker, and a domain vocabulary are general kinds of input. The paper gives no corresponding evaluation on another language or on a collection prepared under different editorial conventions.

What follows from the experimental setup

The benchmark makes the length of the missing span visible. Each question mark defines a position in the answer, and the training spans have lengths in the measured range the authors specify. Real restoration can begin with uncertainty over how many letters the damage removed. That uncertainty may interact with the proposed wording. An inscription can admit readings of different lengths if its layout is unclear. The reported scores assume the supplied length and leave the quality of that initial estimate outside the evaluation.

The experiment simulates loss by hiding text available in the corpus. That gives every scored gap a reference, but it also ties the distribution of gaps to a sampling procedure. Damage and survival in the actual record can leave quite different patterns of evidence. The article’s short-context result shows how performance changes when the input is reduced in the tested way. It does not establish how the sampling procedure represents all forms of wear, fragmentation, or uncertainty in a transcription. The strengths of the benchmark are its exact targets and consistent conditions.

The input is a normalized edition. Features removed or standardized during construction, including the original forms of numerals and some editorial markings, are absent as distinct signals. The architecture has no direct access to the surface, layout reconstruction, or other evidence that a specialist might use when preparing a reading. In particular, the same transcription can support different judgments when the physical traces are reconsidered. The network’s output expresses the evidence available through the encoded text and the patterns acquired in training.

There is also a difference between recovering an exact reference and proposing a defensible reading. A sampled span has one known reference for scoring. Other strings could fit the visible context and still count as errors. An actual gap can admit several plausible restorations, and a published edition represents a scholarly judgment. Conversely, a prediction that agrees with an edition has passed a meaningful comparison without independently verifying what once stood on the surface. The paper’s two kinds of evaluation need to be interpreted with those different references in mind.

The human CER is specific to the participants, work conditions, and exercise. It gives a direct indication that the task they were asked to do was difficult. Generalizing it to all epigraphists or to the outcome of a full editorial investigation would require a broader comparison. The human test also leaves the proposed collaboration unmeasured. Top-20 accuracy tells how frequently the answer is available somewhere in a list. The time required to review the list, the success of choosing among plausible alternatives, and the effect of suggestions on subsequent judgments are separate outcomes.

Finally, the identifier split separates inscriptions, while the paper does not report tests organized around a held-out period, region, or class of documents. That matters when considering the authors’ observation about literary and epigraphic material. Training data drawn from Greek inscriptions as a whole can suit the benchmark and still vary in relevance to particular parts of the record. The reported results measure performance on the PHI-ML split the authors defined. The full-inscription example demonstrates a use of the system without estimating performance across distinct parts of that record.

What came after

Filling gaps in other kinds of sequences

Enabling Language Models to Fill in the Blanks takes up the more general problem of making a text predictor supply a missing span. The connection to PYTHIA is the role of the blank in defining the task. The material on either side remains available as evidence, and the requested output belongs inside that material. PYTHIA formulates this problem for missing inscription characters whose positions have already been marked. The later work frames gap filling as a capability of general text prediction.

InCoder brings the same broad problem to code and programming languages. It addresses both synthesis and infilling. Infilling places the request within an existing piece of code, where material surrounding a blank can constrain what belongs there. That is the common ground with PYTHIA: prediction has to account for a surviving sequence that already extends beyond the gap. The objects being completed differ, and the inscription benchmark supplies no performance evidence about the code task.

These works continue the problem of designing generation around a known location in an input sequence. In PYTHIA, an editor’s estimate gives each missing character a place, and the decoder produces the letters for those places. A wider treatment of infilling can ask what a predictor should do whenever surrounding content has to be respected. The relationship is at the level of the prediction problem. It does not require the later work to inherit PHI-ML, PYTHIA’s encoder, or the convention of specifying one marker per letter.

Computational resources for ancient texts

Latin BERT addresses contextual language representation for classical philology in Latin. Its connection to PYTHIA is the use of surrounding text to study an ancient language computationally. PYTHIA puts that context to work in a targeted restoration task. Latin BERT takes up contextual representation as a resource for classical philology more broadly. This places inscription repair within a larger set of questions about how to obtain computational representations useful for the study of older texts.

Creating a large-scale diachronic corpus resource concerns automatic parsing of Greek papyri and the construction of a resource spanning time. Its output concerns linguistic structure, where PYTHIA’s output is a proposed sequence of missing characters. The link runs through the practical demands of working with large historical collections. PHI-ML turns a corpus of edited inscriptions into material for a specified learning and evaluation task. The papyri work addresses the preparation of a corpus for a different kind of computational analysis, parsing.

Machine Learning for Ancient Languages: A Survey situates research on ancient languages within a shared account of machine learning. Its relationship to PYTHIA is one of synthesis. A restoration study combines a particular corpus, a representation for missing material, and a way to score suggestions. Surveying the wider field puts work of this kind alongside other computational tasks on historical evidence, including tasks whose outputs are readings, annotations, or broader linguistic resources. The role of the survey is to examine that field rather than furnish another score for PYTHIA.

Returning to epigraphic benchmarks

Ithaca Revisited returns to benchmarking a system designed for epigraphy in the setting of large language models. Its subject is the evaluation of a domain-specific approach alongside developments in broader-purpose systems. That makes its connection to PYTHIA particularly direct. PYTHIA’s experiments showed that the source collection, the available context, and the representation of damaged words all matter to the measured task. A later benchmark in the same domain returns to the question of what specialized systems contribute when the comparison changes.

The later work thus follows several aspects of the original study. Infilling research takes up the structure of predicting inside a surviving passage. Work on classical languages examines contextual representations and corpus construction for other scholarly tasks. Later benchmarking returns to the epigraphic setting itself. In PYTHIA’s experiments, the decisive distinction is between having a suggested string available and knowing that it belongs in the inscription. The benchmark can answer the first question for a known reference. For a genuinely lost passage, a suggestion remains a candidate to assess against the surviving evidence.

Cite

Cite as Yannis Assael, Thea Sommerschield and Jonathan Prag. 2019. Restoring ancient text using deep learning: a case study on Greek epigraphy. Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/d19-1668

@inproceedings{assael2019restoring,
  title = {{Restoring ancient text using deep learning: a case study on Greek epigraphy}},
  author = {Yannis Assael, Thea Sommerschield and Jonathan Prag},
  booktitle = {Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)},
  year = {2019},
  doi = {10.18653/v1/d19-1668},
  url = {https://doi.org/10.18653/v1/d19-1668}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/assael-2019-restoring-ancient-text-deep-learning/