CoolFace
Modelpublic

coastalcph/danish-legal-lm-base

sourceHugging Facecc-by-nc-4.0updated 4y agoView on Hugging Face
0likes56downloads
Model Card

Danish Legal LM

This model is pre-training on a combination of the Danish part of the MultiEURLEX (Chalkidis et al., 2021) dataset comprising EU legislation and two subsets (retsinformationdk, retspraksis) of the Danish Gigaword Corpus (Derczynski et al., 2021) comprising legal proceedings. It achieves the following results on the evaluation set:

  • —Loss: 0.7302 (up to 128 tokens)
  • —Loss: 0.7847 (up to 512 tokens)

Model description

This is a RoBERTa (Liu et al., 2019) model pre-trained on Danish legal corpora. It follows a base configuration with 12 Transformer layers, each one with 768 hidden units and 12 attention heads.

Intended uses & limitations

More information needed

Training and evaluation data

This model is pre-training on a combination of the Danish part of the MultiEURLEX dataset and two subsets (retsinformationdk, retspraksis) of the Danish Gigaword Corpus.

Training procedure

The model was initially pre-trained for 500k steps with sequences up to 128 tokens, and then continued pre-training for additional 100k with sequences up to 512 tokens.

Training hyperparameters

The following hyperparameters were used during training:

  • —learning_rate: 0.0001
  • —trainbatchsize: 16
  • —evalbatchsize: 16
  • —seed: 42
  • —distributed_type: tpu
  • —num_devices: 8
  • —gradientaccumulationsteps: 2
  • —totaltrainbatch_size: 256
  • —totalevalbatch_size: 128
  • —optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
  • —lrschedulertype: cosine
  • —lrschedulerwarmup_ratio: 0.05
  • —training_steps: 500000 + 100000

Training results

Training LossLengthStepValidation Loss
1.4648128500001.2920
1.21651281000001.0625
1.09521281500000.9611
1.02331282000000.8931
0.9631282500000.8477
0.91221283000000.8168
0.86971283500000.7836
0.83971284000000.7560
0.82311284500000.7476
0.82071285000000.7243
Training LossLengthStepValidation Loss
0.7045512+500000.8318
0.6432512+1000000.7913

Framework versions

  • —Transformers 4.18.0
  • —Pytorch 1.12.0+cu102
  • —Datasets 2.0.0
  • —Tokenizers 0.12.0