DOI: 10.5281/zenodo.18160596
title: GreLa

description: This repository contains the code for creating, maintaining, and enriching the GreLa corpus.

GreLa is a comprehensive corpus of Greek and Latin literature from the 8th c. BCE to the 17th c. CE.It currently (v0.7) cover 11,127 works, 28,458,277 sentences, and 437,399,526 tokens.

GreLa is constructed as a merge of the following corpora:



LAGT — Lemmatized Ancient Greek Texts, combining ancient Greek texts from the Perseus Digital Library, First 1,000 Years of Greek, Glaux, and OGA (v5.2; DOI: 10.5281/zenodo.17865189).

Corpus Corporum — a comprehensive corpus of Latin literature.

NOSCEMUS — a curated database of Early Modern scientific literature (v1; DOI: 10.5281/zenodo.15040256).

EMLAP — Early Modern Latin Alchemical Prints (v0.7; DOI: 10.5281/zenodo.17834734).

latin-lemmatized-texts — used here as a source for the lemmatized Vulgate.


Corpus statistics




grela_source
works_N
sentences_N
tokens_N




lagt
2,160
2,095,265
38,223,149


cc
7,819
14,229,691
254,770,887


noscemus
975
11,653,856
137,325,383


emlap
100
444,211
6,477,016


vulgate
73
35,254
603,091




GreLa is implemented as a relational database with three main tables: works, sentences, and tokens.The schema links tables through:



grela_id — unique ID for each work (built as <subcorpus>_<work-id>, e.g., cc_12710)

sentence_id — unique ID for each sentence (<grela_id>_<position>, e.g., cc_12710_0, cc_12710_1)


Querying the corpus

The tokens table allows searching by lemma, POS, and positional information (char_start, char_end).Where available, the ref JSON attribute encodes textual reference metadata (such as book/chapter/verse for biblical or otherwise structured texts). This varies significantly across subcorpora.

The sentences table supports efficient search for multi-word string patterns in raw text.

The works table contains rich metadata for each work. The fields not_before and not_after express a chronological interval. Ancient texts often require such interval dating, and GreLa supports temporal uncertainty using Monte Carlo modeling as described in this paper.Following this method, each work is also assigned a date_random point estimate sampled from its interval.

Additionally, the works table provides identifiers such as:



author_viaf

author_wd (Wikidata QID)

author_gnd


as well as subcorpus-specific metadata stored uniformly in the subcorpus_specific_metadata JSON field.

GreLa uses DuckDB, an efficient column-oriented analytical database engine optimized for complex queries over large datasets.



Database Schema Documentation

Table: sentences




Column Name
Data Type
Is Nullable
Default Value




sentence_id
VARCHAR
YES
N/A


grela_id
VARCHAR
YES
N/A


position
INTEGER
YES
N/A


sent_text
VARCHAR
YES
N/A




Table: tokens




Column Name
Data Type
Is Nullable
Default Value




sentence_id
VARCHAR
YES
N/A


grela_id
VARCHAR
YES
N/A


token_text
VARCHAR
YES
N/A


lemma
VARCHAR
YES
N/A


pos
VARCHAR
YES
N/A


ref
JSON
YES
N/A


char_start
INTEGER
YES
N/A


char_end
INTEGER
YES
N/A


token_id
BIGINT
YES
N/A




Table: works




Column Name
Data Type
Is Nullable
Default Value




grela_source
VARCHAR
YES
N/A


grela_id
VARCHAR
YES
N/A


author
VARCHAR
YES
N/A


title
VARCHAR
YES
N/A


not_before
INTEGER
YES
N/A


not_after
INTEGER
YES
N/A


date_random
INTEGER
YES
N/A


provenience
VARCHAR
YES
N/A


place_publication
VARCHAR
YES
N/A


place_geonames
VARCHAR
YES
N/A


author_viaf
VARCHAR
YES
N/A


author_wd
VARCHAR
YES
N/A


author_gnd
VARCHAR
YES
N/A


title_viaf
VARCHAR
YES
N/A


subcorpus_specific_metadata
JSON
YES
N/A


token_count
BIGINT
YES
0


sentence_count
BIGINT
YES
0


---
 
 
 




Getting Started

GreLa is accessible via a public web API.To get started, see the introductory Colab notebook:

👉 GreLa API – getting started

If you want to run the database locally: (1) download all parts of the main database file (grela_v{version number}.duckdb.part{part number}) (2) merge them back into one database file using scripts/merge_db_parts.py (3) follow standard DuckDB instructions to establish a connection with the database



License

The GreLa code, schema, and derived metadata are released underCC BY-SA 4.0 (see LICENSE.md).

The underlying texts and some annotations inherit the licences of the source corpora:



LAGT (Perseus, First 1K Greek, GLAUx, OGA): CC BY-SA 4.0

Corpus Corporum: mix of CC BY-SA 4.0 and public-domain texts

NOSCEMUS: CC BY 4.0

EMLAP: CC BY-SA 4.0

latin-lemmatized-texts (Vulgate): public-domain text, CC BY-SA 4.0 annotations


When reusing GreLa data, please:



Cite GreLa and the relevant source corpus (LAGT, Corpus Corporum, NOSCEMUS, EMLAP, latin-lemmatized-texts, …).

Follow both the GreLa CC BY-SA 4.0 licence and the licence(s) of the original corpus for the texts you use.




Version History





0.7



added missing titles for EMLAP works (formerly wrongly retrieved from an empty "TITLE" attribute)

removed tokens and sentences with "grela_id" that do not exist in works

upon import, reset "sent_id" for sentences from LAGT, since there are repeatly used "sent_id" in case of works combined from multiple parts (such as "007-051a" and "007-051b" in glaux, but here treated as a single work)





0.6



input data in unified format

EMLAP extended to all 100 works

CC input derived from lemmatized XML with ref metadata

works table enriched with VIAF, Wikidata ID, GND

subcorpus-specific attributes unified into subcorpus_specific_metadata





0.5



various minor improvements





0.4



significantly improved Greek sentence and token segmentation

added ref attribute for Greek works





0.1



first version of GreLa






Roadmap



ref attribute documentation

add collaborators as coauthors based on agreement

document licences for all source corpora

more identifiers for works and authors (e.g., PHI IDs for Latin texts)

provenance metadata for Latin texts

standardized spatial metadata for works and authors

ULTIMATE GOAL: a bilingual (Greek and Latin) database-wide token-level and sentence-level contextual embeddings, based on a fine-tuned BERT model allowing (1) diachronic word sense induction & disambiguation and (2) fast retrieval of similar passages, paraphrases, and allusions across the two languages