Pythia: Difference between revisions

From The Digital Classicist Wiki
Jump to navigation Jump to search
No edit summary
m (trimmed cats)
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div id="mw-content-text" lang="en-GB" dir="ltr" class="mw-content-ltr">
==Available==
<div class="mw-parser-output"></div>


<h2>
* https://colab.research.google.com/drive/16RfCpZLm0M6bf3eGIA7VUPclFdW8P8pZ
<span class="mw-headline" id="Available">Available</span>
</h2>


<ul>
==Authors==
<li>[https://colab.research.google.com/drive/16RfCpZLm0M6bf3eGIA7VUPclFdW8P8pZ PYTHIA: the deep learning model for the automatic restoration of Greek inscriptions]</li>
</ul>


<h2>
* [[User:TheaSommerschield|Thea Sommerschield]], University of Oxford
<span class="mw-headline" id="Authors">Authors</span>
* Yannis Assael, DeepMind
</h2>
* Jonathan Prag, University of Oxford


<ul>
==Description==
<li>Thea Sommerschield, University of Oxford</li>
<li>Yannis Assael, DeepMind</li>
<li>Jonathan R. W. Prag, University of Oxford</li>
</ul>


<h2>
'''PYTHIA: a deep learning model for the automatic restoration of Greek inscriptions''' is the first ancient text restoration model that recovers missing characters from a damaged text input using deep neural networks. Bringing together the disciplines of ancient history and deep learning, this research offers a fully automated aid to the epigraphic restoration of fragmentary inscriptions, providing ancient historians with multiple textual restorations, as well as the confidence level for each hypothesis.
<span class="mw-headline" id="Description">Description</span>
</h2>


<p>
Pythia takes a sequence of damaged text as input, and is trained to predict character sequences comprising hypothesised restorations of ancient Greek inscriptions. The architecture works at both the character- and word-level, thereby effectively handling long-term context information, and dealing efficiently with incomplete word representations. This makes it applicable to all disciplines dealing with ancient texts (philology, papyrology, codicology) and applies to any language (ancient or modern).
Ancient History relies on disciplines such as Epigraphy, the study of ancient inscribed texts, for evidence of the recorded past. However, these texts, "inscriptions", are often damaged over the centuries, and illegible parts of the text must be restored by specialists, known as epigraphists. This work presents a novel assistive method for providing text restorations using deep neural networks.
</p>
 
<p>
<b>Pythia</b> is the first ancient text restoration model that recovers missing characters from a damaged text input.  Bringing together the disciplines of ancient history and deep learning, the present work offers a fully automated aid to the text restoration task, providing ancient historians with multiple textual restorations, as well as the confidence level for each hypothesis.
</p>
 
<p>
<b>Pythia</b> takes a sequence of damaged text as input, and is trained to predict character sequences comprising hypothesised restorations of ancient Greek inscriptions (texts written in the Greek alphabet dating between the seventh century BCE and the fifth century CE). The architecture works at both the character- and word-level, thereby effectively handling long-term context information, and dealing efficiently with incomplete word representations. This makes it applicable to all disciplines dealing with ancient texts (philology, papyrology, codicology) and applies to any language (ancient or modern).
</p>


<p>
To train the model, we wrote a non-trivial pipeline to convert [[PHI Greek Inscriptions|PHI]], the largest digital corpus of ancient Greek inscriptions, to machine actionable text, which we call [[PHI-ML]]. On PHI-ML, Pythia's predictions achieve a 30.1% character error rate, compared to the 57.3% of human epigraphists. Moreover, in 73.5% of cases the ground-truth sequence was among the Top-20 hypotheses of Pythia, which effectively demonstrates the impact of such an assistive method on the field of digital epigraphy, and sets the state-of-the-art in ancient text restoration.
To train it, we wrote a non-trivial pipeline to convert [[PHI Greek Inscriptions|PHI]], the largest digital corpus of ancient Greek inscriptions, to machine actionable text, which we call <i>PHI-ML</i>. On <i>PHI-ML</i>, <b>Pythia</b>'s predictions achieve a 30.1% character error rate, compared to the 57.3% of human epigraphists. Moreover, in 73.5% of cases the ground-truth sequence was among the Top-20 hypotheses of <b>Pythia</b>, which effectively demonstrates the impact of such an assistive method on the field of digital epigraphy, and sets the state-of-the-art in ancient text restoration.
</p>


<p>
To aid further research in the field we created a freely accessible [https://colab.research.google.com/drive/16RfCpZLm0M6bf3eGIA7VUPclFdW8P8pZ online interactive Python notebook], where researchers can query one of our models to get text restorations and visualise the attention weights. Follow the instructions on the Colab notebook to restore texts for your own personal research.
To aid further research in the field we created a freely accessible [https://colab.research.google.com/drive/16RfCpZLm0M6bf3eGIA7VUPclFdW8P8pZ online interactive Python notebook], where researchers can query one of our models to get text restorations and visualise the attention weights.  
</p>


<p>
Furthermore, the PHI-ML dataset and processing pipeline have been published on [https://github.com/sommerschield/ancient-text-restoration GitHub], so that any researcher may regenerate PHI-ML and train new models offline. Follow the instructions below under the section ''"Pythia offline"''.
Furthermore, the PHI-ML dataset and processing pipeline have been published on [https://github.com/sommerschield/ancient-text-restoration GitHub], so that any researcher may regenerate PHI-ML and train new models offline. Follow the instructions below under the section ''"Pythia offline"''.
</p>


<h2>
===References===
<span class="mw-headline" id="References">References</span>
</h2>


<p>
Article available at:
Article available at:
<ul>
* [https://www.aclweb.org/anthology/D19-1668/ ACL anthology]
<li>[https://www.aclweb.org/anthology/D19-1668/ ACL anthology]</li>
* [https://arxiv.org/abs/1910.06262 arXiv preprint]
<li>[https://arxiv.org/abs/1910.06262 arXiv preprint]</li>
</ul>
</p>


<p>
To quote this work:
<blockquote>Assael, Y., Sommerschield, T., Prag, J. “Restoring Ancient Text Using Deep Learning: A Case Study on Greek Epigraphy.” In
<blockquote>Assael, Y., Sommerschield, T., Prag, J. “Restoring Ancient Text Using Deep Learning: A Case Study on Greek Epigraphy.” In
''Empirical Methods in Natural Language Processing (EMNLP - IJCNLP 2019)''. Association for Computational Linguistics. 6369-6376.</blockquote>
''Proceedings of the Conference in Empirical Methods in Natural Language Processing (EMNLP - IJCNLP 2019)''. Association for Computational Linguistics. 6369-6376.</blockquote>
</p>


<p>
When using any of this project's source code, please cite:
When using any of this project's source code, please cite:


Line 76: Line 41:
   year={2019}
   year={2019}
}</pre>
}</pre>
</p>


<h2>
===Pythia offline===
<span class="mw-headline" id="Pythia-offline">Pythia offline</span>
</h2>


<p>
The following snippets provide references for regenerating PHI-ML and training new models offline.
The following snippets provide references for regenerating PHI-ML and training new models offline.
</p>


<p>
====Dependencies====
* '''Dependencies'''
<pre>
<pre>
pip install -r requirements.txt && \
pip install -r requirements.txt && \
Line 93: Line 52:
</pre>
</pre>


* '''PHI-ML dataset generation'''
====PHI-ML dataset generation====
<pre>
<pre>
# Download PHI (this will take a while)
# Download PHI (this will take a while)
Line 104: Line 63:
Preprocessed PHI-ML uploaded by @Holger.Danske800: [https://drive.google.com/drive/folders/1PQaWYmB02Sc2OC9yokajcsw65wIcLxGD link]
Preprocessed PHI-ML uploaded by @Holger.Danske800: [https://drive.google.com/drive/folders/1PQaWYmB02Sc2OC9yokajcsw65wIcLxGD link]


* '''Training'''
====Training====
<pre>
<pre>
python -c 'import pythia.train; pythia.train.main()'
python -c 'import pythia.train; pythia.train.main()'
</pre>
</pre>


* '''Evaluation'''
====Evaluation====
<pre>
<pre>
python -c 'import pythia.test; pythia.test.main()' --load_checkpoint="your_model_path/"
python -c 'import pythia.test; pythia.test.main()' --load_checkpoint="your_model_path/"
</pre>
</pre>


* '''Docker execution'''
====Docker execution====
<pre>
<pre>
./build.sh
./build.sh
Line 121: Line 80:
</p>
</p>


<h2>
===Media===
<span class="mw-headline" id="Media">Media</span>
 
</h2>
Our research has been featured in blog posts by [https://deepmind.com/research/publications/Restoring-ancient-text-using-deep-learning-a-case-study-on-Greek-epigraphy DeepMind] and the [http://www.ox.ac.uk/news/arts-blog/restoring-ancient-greek-inscriptions-using-ai-deep-learning University of Oxford], and has been published in articles on [https://www.thetimes.co.uk/article/oracle-of-ai-solves-classic-conundrums-v6pdtsps0 The Times], [https://www.newscientist.com/article/2220438-deepmind-ai-beats-humans-at-deciphering-damaged-ancient-greek-tablets/ NewScientist], [https://www.ft.com/content/2b72ed2c-907b-11ea-bc44-dbf6756c871a?FTCamp=engage%2FCAPI%2F%2FChannel_signal%2F%2FB2B/ Financial Times], [https://www.repubblica.it/tecnologia/2019/10/24/news/non_solo_go_l_ai_di_google_batte_anche_gli_archeologi-239393979/ La Repubblica], [https://www.kathimerini.gr/1047963/article/epikairothta/episthmh/py8ia-o-gonos-ths-google-kai-ellhna-ereynhth-poy-diavazei-misokatestrammenes-arxaies-epigrafes Ekathimerini], [https://techcrunch.com/2019/10/18/ai-is-helping-scholars-restore-ancient-greek-texts-on-stone-tablets/ TechCrunch] and others.


<p>
Our research has been featured in blog posts by [https://deepmind.com/research/publications/Restoring-ancient-text-using-deep-learning-a-case-study-on-Greek-epigraphy DeepMind] and the [http://www.ox.ac.uk/news/arts-blog/restoring-ancient-greek-inscriptions-using-ai-deep-learning University of Oxford], and has been published in articles on [https://www.thetimes.co.uk/article/oracle-of-ai-solves-classic-conundrums-v6pdtsps0 The Times], [https://www.newscientist.com/article/2220438-deepmind-ai-beats-humans-at-deciphering-damaged-ancient-greek-tablets/ NewScientist], [https://www.repubblica.it/tecnologia/2019/10/24/news/non_solo_go_l_ai_di_google_batte_anche_gli_archeologi-239393979/ La Repubblica], [https://www.kathimerini.gr/1047963/article/epikairothta/episthmh/py8ia-o-gonos-ths-google-kai-ellhna-ereynhth-poy-diavazei-misokatestrammenes-arxaies-epigrafes Ekathimerini], [https://techcrunch.com/2019/10/18/ai-is-helping-scholars-restore-ancient-greek-texts-on-stone-tablets/ TechCrunch] and others.
</p>
<p>
It has also been presented at [https://www.emnlp-ijcnlp2019.org/ EMNLP - IJCNLP 2019] in Hong Kong, at the British School at Rome, the Oxford Epigraphy Workshop, the OIKOS National Research School in Classical Studies, during lectures at Venice Ca' Foscari and Rome La Sapienza, and most recently at the [https://www.youtube.com/watch?v=nKSfzHYmLtQ&t=26s Digital Classicist London Seminar].
It has also been presented at [https://www.emnlp-ijcnlp2019.org/ EMNLP - IJCNLP 2019] in Hong Kong, at the British School at Rome, the Oxford Epigraphy Workshop, the OIKOS National Research School in Classical Studies, during lectures at Venice Ca' Foscari and Rome La Sapienza, and most recently at the [https://www.youtube.com/watch?v=nKSfzHYmLtQ&t=26s Digital Classicist London Seminar].
</p>


<p>
Pythia is a partner project of [[epigraphy.info]].
Pythia is a partner project of [[epigraphy.info]].


<h2>
===Contact===
<span class="mw-headline" id="Contact">Contact</span>
</h2>


<ul>
* [http://thea.sommerschield@classics.ox.ac.uk thea.sommerschield@classics.ox.ac.uk]
<li>[http://thea.sommerschield@classics.ox.ac.uk thea.sommerschield@classics.ox.ac.uk]</li>
</ul>


[[category:tools]]  
[[category:tools]]  
Line 148: Line 97:
[[category:corpora]]
[[category:corpora]]
[[category:dataset]]
[[category:dataset]]
[[category:deep learning]]
[[category:digital library]]
[[category:digital library]]
[[category:digitization]]
[[category:digitization]]
[[category:inscriptions]]
[[category:machine learning]]
[[category:machine learning]]
[[category:NLP]]
[[category:NLP]]
[[category:neural networks]]
[[category:Openaccess]]
[[category:Openaccess]]
[[category:Opensource]]
[[category:Opensource]]
Line 160: Line 106:
[[category:text mining]]
[[category:text mining]]
[[category:web service]]
[[category:web service]]
</div>

Revision as of 17:07, 14 July 2020

Available

Authors

  • Thea Sommerschield, University of Oxford
  • Yannis Assael, DeepMind
  • Jonathan Prag, University of Oxford

Description

PYTHIA: a deep learning model for the automatic restoration of Greek inscriptions is the first ancient text restoration model that recovers missing characters from a damaged text input using deep neural networks. Bringing together the disciplines of ancient history and deep learning, this research offers a fully automated aid to the epigraphic restoration of fragmentary inscriptions, providing ancient historians with multiple textual restorations, as well as the confidence level for each hypothesis.

Pythia takes a sequence of damaged text as input, and is trained to predict character sequences comprising hypothesised restorations of ancient Greek inscriptions. The architecture works at both the character- and word-level, thereby effectively handling long-term context information, and dealing efficiently with incomplete word representations. This makes it applicable to all disciplines dealing with ancient texts (philology, papyrology, codicology) and applies to any language (ancient or modern).

To train the model, we wrote a non-trivial pipeline to convert PHI, the largest digital corpus of ancient Greek inscriptions, to machine actionable text, which we call PHI-ML. On PHI-ML, Pythia's predictions achieve a 30.1% character error rate, compared to the 57.3% of human epigraphists. Moreover, in 73.5% of cases the ground-truth sequence was among the Top-20 hypotheses of Pythia, which effectively demonstrates the impact of such an assistive method on the field of digital epigraphy, and sets the state-of-the-art in ancient text restoration.

To aid further research in the field we created a freely accessible online interactive Python notebook, where researchers can query one of our models to get text restorations and visualise the attention weights. Follow the instructions on the Colab notebook to restore texts for your own personal research.

Furthermore, the PHI-ML dataset and processing pipeline have been published on GitHub, so that any researcher may regenerate PHI-ML and train new models offline. Follow the instructions below under the section "Pythia offline".

References

Article available at:

To quote this work:

Assael, Y., Sommerschield, T., Prag, J. “Restoring Ancient Text Using Deep Learning: A Case Study on Greek Epigraphy.” In Proceedings of the Conference in Empirical Methods in Natural Language Processing (EMNLP - IJCNLP 2019). Association for Computational Linguistics. 6369-6376.

When using any of this project's source code, please cite:

@inproceedings{assael2019restoring,
  title={Restoring ancient text using deep learning: a case study on {Greek} epigraphy},
  author={Assael, Yannis and Sommerschield, Thea and Prag, Jonathan},
  booktitle={Empirical Methods in Natural Language Processing},
  pages={6369--6376},
  year={2019}
}

Pythia offline

The following snippets provide references for regenerating PHI-ML and training new models offline.

Dependencies

pip install -r requirements.txt && \
python -m nltk.downloader punkt

PHI-ML dataset generation

# Download PHI (this will take a while)
python -c 'import pythia.data.phi_download; pythia.data.phi_download.main()'

# Process and generate PHI-ML
python -c 'import pythia.data.phi_process; pythia.data.phi_process.main()'

Preprocessed PHI-ML uploaded by @Holger.Danske800: link

Training

python -c 'import pythia.train; pythia.train.main()'

Evaluation

python -c 'import pythia.test; pythia.test.main()' --load_checkpoint="your_model_path/"

Docker execution

./build.sh
./run.sh <GPU_ID> python -c 'import pythia.train; pythia.train.main()'

Media

Our research has been featured in blog posts by DeepMind and the University of Oxford, and has been published in articles on The Times, NewScientist, Financial Times, La Repubblica, Ekathimerini, TechCrunch and others.

It has also been presented at EMNLP - IJCNLP 2019 in Hong Kong, at the British School at Rome, the Oxford Epigraphy Workshop, the OIKOS National Research School in Classical Studies, during lectures at Venice Ca' Foscari and Rome La Sapienza, and most recently at the Digital Classicist London Seminar.

Pythia is a partner project of epigraphy.info.

Contact