CoolFace
Modelpublic

JQ1984/legalbert_gdpr_pretrained

sourceHugging Facecc-by-nc-4.0updated 1y agoView on Hugging Face
0likes10downloads
Model Card

Legal-BERT (GDPR Pretrained Version)

This model is based on `nlpaueb/legal-bert-base-uncased`, and has been further pretrained on the full text of the General Data Protection Regulation (GDPR) to adapt it to privacy law and regulatory compliance scenarios.

🧠 What’s New?

We adapted Legal-BERT through masked language modeling (MLM) on GDPR-specific language, enhancing the model’s understanding of:

  • β€”Personal data protection terms
  • β€”GDPR article structure
  • β€”Typical compliance language and risk descriptions

The training corpus includes official GDPR text, split into clean English sentences, formatted for MLM.

πŸ”§ Intended Use

This specialized model is best suited for:

  • β€”GDPR compliance assistance
  • β€”Legal document classification and clause matching
  • β€”Privacy policy analysis
  • β€”Regulatory question answering (when further fine-tuned)

πŸ’Ύ Training Details

  • β€”Base model: nlpaueb/legal-bert-base-uncased
  • β€”Task: Masked Language Modeling (MLM)
  • β€”Corpus: Full official GDPR English text (~10,000+ sentences)
  • β€”Epochs: 3
  • β€”Block size: 128
  • β€”Batch size: 16
  • β€”MLM Probability: 15%

πŸ›  How to Use

python
from transformers import AutoTokenizer, AutoModelForMaskedLM

tokenizer = AutoTokenizer.from_pretrained("JQ1984/legalbert_gdpr_pretrained")
model = AutoModelForMaskedLM.from_pretrained("JQ1984/legalbert_gdpr_pretrained")

# Example
inputs = tokenizer("The data controller shall ensure that personal data is", return_tensors="pt")
outputs = model(**inputs)


## References

* [Model Paper](https://arxiv.org/abs/xxxx.xxxxx)