greCy
Ancient Greek models for spaCy
greCy is a set of spaCy ancient Greek models and its installer. The models were trained using the Perseus and Proiel UD corpora.
Installation
First install the python package as usual:
pip install -U grecy
Once the package is successfully installed, you can proceed to install any of the followings models:
- grc_perseus_sm
- grc_proiel_sm
- grc_perseus_lg
- grc_proiel_lg
- grc_perseus_trf
- grc_proiel_trf
- grc_ner_trf
The models can be installed from the terminal with the commands below:
python -m grecy install MODEL
where you replace MODEL by any of the model names listed above. The installer always downloads the most recent version of the model published in the greCy releases. The transformer models (_trf) currently need Python 3.13 or earlier; the other models also work on Python 3.14. The suffixes after the corpus name _sm, _lg, and _trf indicate the size of the model, which directly depends on the word embeddings used to train the models. The smallest models end in _sm (small) and are the less accurate ones: they are good for testing and building lightweight apps. The _lg and _trf are the large and transformer models which are more accurate. The _lg were trained using floret word vectors, and the _trf models use a special version of BERT that was pretrained with the largest Ancient Greek corpus available in the web.
Loading
As usual, you can load any of the models with the following Python lines:
import spacy
nlp = spacy.load("grc_proiel_XX")
Remember to replace _XX with the size of the model you would like to use, this means, _sm for small, _lg for large, and _trf for transformer. The _trf model is the most accurate but also the slowest.
Use
spaCy is a powerful NLP library with many applications. The most basic of its function is the morpho-syntantic annotation of texts for further processing. A common routine is to load a model, create a doc object, and process a text:
import spacy
nlp = spacy.load("grc_proiel_trf")
text = "καὶ πρὶν μὲν ἐν κακοῖσι κειμένην ὅμως ἐλπίς μʼ ἀεὶ προσῆγε σωθέντος τέκνου ἀλκήν τινʼ εὑρεῖν κἀπικούρησιν δόμον"
doc = nlp(text)
for token in doc:
print(f'{token.text}, lemma: {token.lemma_} pos:{token.pos_}')
The apostrophe issue
Unfortunately, there is no consensus how to represent the Ancient Greek apostrophe. Modern Greek simply uses the regular apostrophe, but ancient texts available in Perseus and Perseus under Philologic use various unicode characters for the apostrophe. Instead of the apostrophe, we find the 'Greek koronis', 'modifier letter apostrophe', and 'right single quotation mark.' Provisionally, I have opted to use 'modifier letter apostrophe' in the corpora with which I trained the models. This means that, if you want the greCy models to properly handle the apostrophe, you have to make sure that the Ancient Greek texts that you are processing use the modifier letter apostrophe ʼ (U+02BC ). Otherwise the models will fail to lemmatize and tag some words in your texts that ends with an 'apostrophe'.
Metadata
Release files for grecy 3.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| grecy-3.8.tar.gz | 5.6 kB | Without provenance | Details for grecy-3.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| grecy-3.8-py3-none-any.whl | Python 3 | none | any | Details for grecy-3.8-py3-none-any.whl |
Total release size: 11.7 kB
Release files / grecy-3.8.tar.gz
| Download URL | grecy-3.8.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1dfbda71d7905e27564b61ed18bd06a66dbf10540b43d2dc74797a3e0fc1a6d
|
|
BLAKE2b-256 checksum How to use checksums |
0c56772b7ac236929969a415d8f01999e0d7b27e5631253dd5f8de047cbe54ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / grecy-3.8-py3-none-any.whl
| Download URL | grecy-3.8-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ae94b454407f0f2005c51a1cc924a8c5443a26523a144b7ac6e072f85b75da4
|
|
BLAKE2b-256 checksum How to use checksums |
67aadbf62095a024d12952e1933827295b43639fb323184dde7f1866da6c59e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Security for grecy 3.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.