Downloads · 30 days
22
0% of all-time downloads
novelcore/gem-electra
gem-electra is a fill-mask model from novelcore. Use it when you need the model to fill a missing word. It is set up for transformers. The card lists the license as apache-2.0.
GEM-ELECTRA Legal is an improved ELECTRA-base model pre-trained from scratch on a large, 17GB corpus of Greek legal, parliamentary, and governmental text. This second version incorporates refined training hyperparamet…
Downloads · 30 days
22
0% of all-time downloads
All-time downloads
90.2K
Public
Parameters
125M
500 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors499 MB · 100%
From the Hugging Face model README
GEM-ELECTRA Legal is an improved ELECTRA-base model pre-trained from scratch on a large, 17GB corpus of Greek legal, parliamentary, and governmental text. This second version incorporates refined training hyperparameters for enhanced performance and stability. It is designed for understanding the complex vocabulary and context of the legal domain in Greece and the EU.
This model was trained as part of a research project and has been optimized for downstream tasks such as Named Entity Recognition (NER), Text Classification, and Question Answering within the legal field. The ELECTRA architecture provides more efficient pre-training compared to masked language models like BERT by using a generator-discriminator approach.
You can use this model directly with the fill-mask pipeline:
from transformers import pipeline
# Load the model
fill_mask = pipeline(
"fill-mask",
model="novelcore/gem-electra-legal",
tokenizer="novelcore/gem-electra-legal"
)
# Example from a legal context
text = "Ο κ. Μητσοτάκης <mask> ότι η κυβέρνηση σέβεται πλήρως τις αποφάσεις του Συμβουλίου της Επικρατείας."
# Get predictions
predictions = fill_mask(text)
print(predictions)
For downstream tasks:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# For legal document classification
tokenizer = AutoTokenizer.from_pretrained("novelcore/gem-electra-legal")
model = AutoModelForSequenceClassification.from_pretrained("novelcore/gem-electra-legal")
The model was pre-trained on a comprehensive 17GB corpus of Greek text compiled from various legal and governmental sources. The corpus was carefully cleaned, UTF-8 encoded, and deduplicated to ensure high quality and diversity before training.
The composition of the training corpus is as follows:
| Corpus Source | Size (GB) | Context |
|---|---|---|
| FEK - Greek Government Gazette (all issues) | 11.0 | Legal |
| Greek Parliament Proceedings | 2.9 | Legal / Parliamentary |
| Political Reports of the Supreme Court | 1.2 | Legal |
| Eur-Lex (Greek Content) | 0.92 | Legal |
| Europarl (Greek Content) | 0.38 | Legal / Parliamentary |
| Raptarchis Legal Dictionary | 0.35 | Legal |
| Total | ~16.75 GB |
The model uses the ELECTRA architecture with the following configuration:
The text was tokenized using a custom ByteLevelBPE tokenizer trained from scratch on the Greek legal corpus. The tokenizer is uncased (does not distinguish between upper and lower case) and uses a vocabulary of 50,264 tokens.
The data was then processed into fixed-size chunks of 512 tokens, respecting document boundaries to ensure contextual coherence.
The model was pre-trained from scratch for 200,000 steps on 8x NVIDIA A100 40GB GPUs, using BFloat16 (bf16) mixed-precision for stability and speed. This second version incorporates improved hyperparameters for enhanced convergence and performance.
The key hyperparameters used were:
per_device_train_batch_size: 60, gradient_accumulation_steps: 8)beta1=0.9, beta2=0.98, epsilon=1e-6The model achieved the following performance metrics: