Skip to main content

AGILe: Ancient Greek Inscriptions Lemmatizer

AGILe is a lemmatizer for Ancient Greek inscriptions developed at the University of Groningen. Details can be found in:

de Graaf, E., Stopponi, S., Bos, J., Peels-Matthey, S. & Nissim, M. (2022). AGILe: The First Lemmatizer for Ancient Greek Inscriptions. Proceedings of the 13th Conference on Language Resources and Evaluation (LREC 2022), Marseille, 20-25 June 2022. pp. 5334–5344. http://www.lrec-conf.org/proceedings/lrec2022/pdf/2022.lrec-1.571.pdf

Peels-Matthey, S., de Graaf, E., Nissim, M., Bos, J. & Stopponi, S. (2024). Automatic lemmatization of ancient Greek inscriptions: A presentation of AGILe. Journal of epigraphic studies. 7, 2024: 29-50. https://pure.rug.nl/ws/portalfiles/portal/1054237044/Peels-Matthey_et_al_2024_Automatic_lemmatization_of_Ancient_Greek_inscriptions_-_A_presentationof_AGILe.pdf

Relation to agile-gronlp/agile

This repository is a maintained fork of agile-gronlp/agile, packaged for installation with pip. The differences that matter to you:

  • No cltk dependency. The original required cltk 1.0.21, which no longer installs on recent Python versions (its pinned PyYAML 5.4.1 has no wheels past Python 3.9 and does not build against Cython 3). Only one function was needed, and it now lives in this package.
  • Installable. No cloning, no manual dependency wrangling.
  • Runs on Windows, macOS and Linux.

If you are following instructions that tell you to clone agile-gronlp/agile and run pip install -r requirements.txt, you are on the old path and will hit a build error on PyYAML. Use the instructions below instead.

Installation

pip install ancientgreek

Or straight from this repository:

pip install git+https://github.com/prhbrt/ancientgreek

Python 3.9 or later. Installing into a virtual environment is recommended but not required.

Downloading the Stanza models

The Ancient Greek models from Stanza are downloaded once, from your Python interpreter:

>>> import stanza
>>> stanza.download('grc')

Usage

>>> from ancientgreek import lemmatize

>>> doc = lemmatize("αἲξ θύεται τάδε μὴ ἐσφέρεν ἐς τὸ τέμενος τοῦ Ἀπόλλωνος τοῦ Οὐλίου εἱμάτιον")
>>> for sent in doc.sentences:
...     for word in sent.words:
...         print(f'word: {word.text + " ":15}lemma: {word.lemma}')

This gives:

word: αἲξ            lemma: αἴξ
word: θύεται         lemma: θύω
word: τάδε           lemma: ὅδε
word: μὴ             lemma: μή
word: ἐσφέρεν        lemma: εἰσφέρω
word: ἐς             lemma: εἰς
word: τὸ             lemma: τε
word: τέμενος        lemma: τέμενος
word: τοῦ            lemma: ποῦ
word: Ἀπόλλωνος      lemma: Ἀπόλλων
word: τοῦ            lemma: ποῦ
word: Οὐλίου         lemma: οὔλιος
word: εἱμάτιον       lemma: ἱμάτιον

The lexicon lookup can be disabled by setting the use_lexicon parameter of lemmatize to False.

To check your installation from the shell:

python -c "from ancientgreek import lemmatize; print([(w.text, w.lemma) for s in lemmatize('αἲξ θύεται τάδε').sentences for w in s.words])"

On Windows, set PYTHONUTF8=1 first, otherwise printing Greek to the console raises a UnicodeEncodeError:

$env:PYTHONUTF8=1

Interactive notebook on Google Colab

To try AGILe without installing it: https://colab.research.google.com/drive/1YZMGxF8ORCrk_tyD1muHkgVsMXxeWHJJ?usp=drive_link

Acknowledgements

The lexicon.p used is extracted from an XML edition with composed Unicode of the LSJ, as transformed by Giuseppe G. A. Celano. The original text is provided under a CC BY-SA license by Perseus Digital Library, http://www.perseus.tufts.edu, with funding from The National Endowment for the Humanities. Data accessed from https://github.com/PerseusDL/lexica/.

License

Creative Commons License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

BibTeX

@InProceedings{degraaf-EtAl:2022:LREC,
  author    = {de Graaf, Evelien  and  Stopponi, Silvia  and  Bos, Jasper K.  and  Peels-Matthey, Saskia  and  Nissim, Malvina},
  title     = {AGILe: The First Lemmatizer for Ancient Greek Inscriptions},
  booktitle = {Proceedings of the Language Resources and Evaluation Conference},
  month     = {June},
  year      = {2022},
  address   = {Marseille, France},
  publisher = {European Language Resources Association},
  pages     = {5334--5344},
  url       = {https://aclanthology.org/2022.lrec-1.571}
}
@article{peels2024automatic,
  title={Automatic lemmatization of ancient Greek inscriptions: A presentation of AGILe},
  author={Peels-Matthey, Saskia and de Graaf, Evelien and Nissim, Malvina and Bos, Jasper and Stopponi, Silvia},
  journal={Journal of epigraphic studies: 7, 2024},
  pages={29--50},
  year={2024},
  publisher={Fabrizio Serra}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ancientgreek-0.2.2.tar.gz (648.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ancientgreek-0.2.2-py3-none-any.whl (701.6 kB view details)

Uploaded Python 3

File details

Details for the file ancientgreek-0.2.2.tar.gz.

File metadata

  • Download URL: ancientgreek-0.2.2.tar.gz
  • Upload date:
  • Size: 648.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.13

File hashes

Hashes for ancientgreek-0.2.2.tar.gz
Algorithm Hash digest
SHA256 6c5d4caf4b7669b3a040ea235e5613ae7e5c694e129265c8b14cdd0c6dcf67cf
MD5 5000c63259e6f442758bff9a8baf9f93
BLAKE2b-256 bc205a6a98376dac7fd5ce9e05feb9d1d4adde2fa45adb7271408043215f7033

See more details on using hashes here.

File details

Details for the file ancientgreek-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: ancientgreek-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 701.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.13

File hashes

Hashes for ancientgreek-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 417c22de32110b6a0dfac8a0f6f6e8d492cc956a8fa1c2a938c4a5c6bf4844f0
MD5 e770e351f3ebafc44492140353002925
BLAKE2b-256 5eaabbcd974bfd4c0b5a9c820d695d46158bf2a60bb472b50bc48dc6a704cd98

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.0

2 files

0.2.4

2 files

0.2.3

2 files

This release

0.2.2 This release

2 files

0.2.1

1 file

0.1.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page