Downloads · 30 days
14
6% of all-time downloads
novelcore/gem-xlm-roberta
gem-xlm-roberta 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-XLM-RoBERTa Legal 26G is an XLM-RoBERTa-base model pre-trained from scratch on a comprehensive 26GB bilingual corpus of Greek and English legal, parliamentary, and governmental text. This model leverages the advan…
Downloads · 30 days
14
6% of all-time downloads
All-time downloads
241
Public
Parameters
125M
499 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors499 MB · 99%
From the Hugging Face model README
GEM-XLM-RoBERTa Legal 26G is an XLM-RoBERTa-base model pre-trained from scratch on a comprehensive 26GB bilingual corpus of Greek and English legal, parliamentary, and governmental text. This model leverages the advanced cross-lingual capabilities of the XLM-RoBERTa architecture to create superior bilingual legal understanding and cross-lingual transfer learning.
The model builds upon the XLM-RoBERTa architecture, which is specifically designed for multilingual and cross-lingual tasks, making it ideal for bilingual legal applications. Unlike standard RoBERTa, XLM-RoBERTa incorporates advanced cross-lingual pre-training techniques that enable better alignment between Greek and English legal concepts.
This model represents a significant advancement in cross-lingual legal language modeling, combining the rich legal traditions of Greek civil law and English common law in a unified multilingual framework. The model builds upon legal datasets including portions of the Pile of Law collection from Hugging Face, enhanced with comprehensive Greek legal corpora.
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-xlm-roberta",
tokenizer="novelcore/gem-xlm-roberta"
)
# Example in Greek
text_gr = "Ο κ. Μητσοτάκης <mask> ότι η κυβέρνηση σέβεται πλήρως τις αποφάσεις του Συμβουλίου της Επικρατείας."
predictions_gr = fill_mask(text_gr)
print("Greek predictions:", predictions_gr)
For downstream tasks:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
# For cross-lingual legal document classification
tokenizer = AutoTokenizer.from_pretrained("novelcore/gem-xlm-roberta")
model = AutoModelForSequenceClassification.from_pretrained("novelcore/gem-xlm-roberta")
# Process texts in both languages with shared representations
greek_text = "Το Συνταγματικό Δικαστήριο αποφάσισε..."
english_text = "The Constitutional Court decided..."
# The model can handle both with unified understanding
The model was pre-trained on a comprehensive 26GB bilingual corpus comprising 60.3% Greek legal content (13.85GB) and 39.7% English legal content (9.12GB), optimized for cross-lingual legal understanding through the XLM-RoBERTa architecture.
| Dataset | Size (GB) | Context | Cross-lingual Value |
|---|---|---|---|
| FEK - Greek Government Gazette | 11.0 | Legal/Regulatory | Regulatory language alignment with English equivalents |
| Greek Parliament Proceedings | 2.9 | Legal/Parliamentary | Legislative discourse paralleling English parliamentary language |
| Political Reports of Supreme Court | 1.2 | Legal/Judicial | Judicial reasoning transferable to common law contexts |
| Eur-Lex (Greek Content) | 0.92 | Legal/EU | Direct multilingual EU legal framework |
| Europarl (Greek Content) | 0.38 | Legal/Parliamentary | Parallel parliamentary proceedings |
| Raptarchis Legal Dictionary | 0.35 | Legal/Reference | Legal terminology with cross-lingual legal concepts |
| Dataset | Size (GB) | Context | Cross-lingual Value |
|---|---|---|---|
| CourtListener Opinions | 4.2 | Legal/Judicial | Common law reasoning complementing civil law |
| EDGAR (SEC Filings) | 2.1 | Legal/Corporate | Corporate law framework transferable across jurisdictions |
| Eur-Lex (English) | 1.1 | Legal/EU | Direct parallel to Greek EU legal content |
| US Bills | 1.0 | Legal/Legislative | Legislative language paralleling Greek parliamentary discourse |
| CFR (Code of Federal Regulations) | 0.48 | Legal/Regulatory | Regulatory framework complementing Greek FEK |
| Europarl (English) | 0.24 | Legal/Parliamentary | Direct parallel to Greek Europarl content |
| Federal Register | 0.12 | Legal/Regulatory | Government publications paralleling Greek gazette |
Note: English legal datasets partially sourced from the Pile of Law collection on Hugging Face.
The XLM-RoBERTa architecture enables superior cross-lingual learning through:
The model uses the XLM-RoBERTa-base architecture with the following configuration:
The text was tokenized using a custom multilingual SentencePiece tokenizer trained from scratch on the bilingual Greek-English legal corpus. The tokenizer uses a vocabulary of 50,264 tokens specifically optimized for cross-lingual legal terminology, enabling effective shared representations between Greek and English legal concepts.
The data was processed into fixed-size chunks of 512 tokens, with special attention to maintaining cross-lingual document alignment and contextual coherence across both languages.
The model was pre-trained from scratch for 150,000 steps on 8x NVIDIA H100 GPUs, using BFloat16 (bf16) mixed-precision for stability and speed. The training took approximately 24 hours and 27 minutes to complete.
The key hyperparameters used were:
per_device_train_batch_size: 128, gradient_accumulation_steps: 2)The model achieved excellent performance metrics, demonstrating superior cross-lingual convergence: