SAVRN
Search Contact SAVRN

Open-weight model · Fill mask

juribert-base

by DaSciM dascim/juribert-base

JuriBERT is a set of BERT models (tiny, mini, small and base) pre-trained from scratch on French legal-domain specific corpora.

Parameters111M
Context512
Weights442.6 MB
Licensemit
AccessOpen weights
Monthly Downloads447.5k

Runs On

What it takes to serve juribert-base (111M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.2 GB 0.3 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

Model Card

By DaSciM, published under mit, revision 735b7d1dffc4.

JuriBERT is a set of BERT models (tiny, mini, small and base) pre-trained from scratch on French legal-domain specific corpora. JuriBERT models are pretrained on 6.3GB of legal french raw text from two different sources: the first dataset is crawled from Légifrance and the other one consists of anonymized court’s decisions and the pleadings from the Court of Cassation (mémoires ampliatifs). The latter contains more than 100k long documents from different court cases. It is now on Hugging Face in four different versions with varying number of parameters. JuriBERT was trained and evaluated at École Polytechnique in collaboration with HEC Paris by Stella Douka, Hadi Abdine, Mihcalis…

Read DaSciM's full model card

JuriBERT: A Masked-Language Model Adaptation for French Legal Text

Introduction

JuriBERT is a set of BERT models (tiny, mini, small and base) pre-trained from scratch on French legal-domain specific corpora. JuriBERT models are pretrained on 6.3GB of legal french raw text from two different sources: the first dataset is crawled from Légifrance and the other one consists of anonymized court’s decisions and the pleadings from the Court of Cassation (mémoires ampliatifs). The latter contains more than 100k long documents from different court cases.

It is now on Hugging Face in four different versions with varying number of parameters.

JuriBERT Pre-trained models

Model #params Architecture
dascim/juribert-tiny 6M Tiny (L=2, H=128, A=2)
dascim/juribert-mini 15M Mini (L=4, H=256, A=4)
dascim/juribert-small 42M Small (L=6, H=512, A=8)
dascim/juribert-base 110M Base (L=12, H=768, A=12)

JuriBERT Usage

Load JuriBERT and its sub-word tokenizer :

from transformers import AutoModel, AutoTokenizer

# You can replace "juribert-base" with any other model from the table, e.g. "dascim/juribert-small".
tokenizer = AutoTokenizer.from_pretrained("dascim/juribert-base")
juribert = AutoModel.from_pretrained("dascim/juribert-base")

juribert.eval()  # disable dropout (or leave in train mode to finetune)

Filling masks using pipeline

from transformers import pipeline 

juribert_fill_mask  = pipeline("fill-mask", model="dascim/juribert-base", tokenizer="dascim/juribert-base")
results = juribert_fill_mask("la chambre <mask> est une chambre de la cour de cassation.")
# results
# [{'score': 0.3455437421798706, 'token': 579, 'token_str': ' civile', 'sequence': 'la chambre civile est une chambre de la cour de cassation.'}, 
# {'score': 0.13046401739120483, 'token': 397, 'token_str': ' qui', 'sequence': 'la chambre qui est une chambre de la cour de cassation.'}, 
# {'score': 0.12387491017580032, 'token': 1060, 'token_str': ' sociale', 'sequence': 'la chambre sociale est une chambre de la cour de cassation.'}, 
# {'score': 0.05491165071725845, 'token': 266, 'token_str': ' c', 'sequence': 'la chambre c est une chambre de la cour de cassation.'},
# {'score': 0.04244831204414368, 'token': 2421, 'token_str': ' commerciale', 'sequence': 'la chambre commerciale est une chambre de la cour de cassation.'}]

Extract contextual embedding features from JuriBERT output

encoded_sentence = tokenizer.encode("Les articles 21 et 22 de la présente annexe sont applicables au titre V de la loi du 1er juin 1924 mettant en vigueur la législation civile française dans les départements du Bas-Rhin, du Haut-Rhin et de la Moselle, et relatif à l'exécution forcée sur les immeubles, à la procédure en matière de purge des hypothèques et à la procédure d'ordre.", return_tensors='pt')

embeddings = juribert(encoded_sentence).last_hidden_state
print(embeddings)
# tensor([[[-0.5490, -1.4505, -0.6244,  ..., -0.9739,  0.4767, -0.0655],
#          [ 0.6415, -1.4368,  0.8708,  ..., -0.4093,  0.6691,  0.7238],
#          [-0.2195, -0.1235,  0.2674,  ...,  0.5372, -0.4903,  0.5960],
#          ...,
#          [-1.4168, -1.3238,  1.1748,  ...,  0.7590,  1.0338, -0.4865],
#          [-0.5240, -0.7168,  0.8667,  ..., -0.5848,  1.0086, -1.3153],
#          [ 0.2743, -0.3438,  1.1101,  ..., -0.5587,  0.0830, -0.3144]]],
#        grad_fn=<NativeLayerNormBackward0>)

Authors

JuriBERT was trained and evaluated at École Polytechnique in collaboration with HEC Paris by Stella Douka, Hadi Abdine, Mihcalis Vazirgiannis, Rajaa El Hamdani and David Restrepo Amariles.

Citation

If you use our work, please cite:

@inproceedings{douka-etal-2021-juribert,
         title = "{J}uri{BERT}: A Masked-Language Model Adaptation for {F}rench Legal Text",
         author="Douka, Stella and Abdine, Hadi and Vazirgiannis, Michalis and El Hamdani, Rajaa and Restrepo Amariles, David",
         booktitle="Proceedings of the Natural Legal Language Processing Workshop 2021",
         month=nov,
         year="2021",
         address = "Punta Cana, Dominican Republic",
         publisher = "Association for Computational Linguistics",
         url = "https://aclanthology.org/2021.nllp-1.9",
         pages = "95--101",
         }

Configuration

Architecture
BertForMaskedLM
Context length (tokens)
512
Layers
12
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Vocabulary size
32,000
Stored precision
float32
Model type
bert

Identity and Version

Repository
dascim/juribert-base
Publisher
DaSciM
Task
Fill mask
Modality
Text
Library
transformers
Parameters
111M parameters
Languages
fr
Revision
735b7d1dffc4bd93b78dac1aff6bff448e70c06c
First published
2024-10-14
Last updated
2024-10-14

Files and Weights

10 files, 445.0 MB in total. The weights are 1 file totalling 442.6 MB in safetensors.

Weights1 file · 442.6 MB
Configuration3 files · 1.7 KB
Tokenizer4 files · 2.3 MB
Documentation1 file · 4.7 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights442.6 MB 069ee172ecb9
config.jsonConfiguration697 B
generation_config.jsonConfiguration90 B
special_tokens_map.jsonConfiguration958 B
README.mdDocumentation4.7 KB
.gitattributesRepository1.5 KB
merges.txtTokenizer343.7 KB
tokenizer.jsonTokenizer1.4 MB
tokenizer_config.jsonTokenizer1.2 KB
vocab.jsonTokenizer557.6 KB

License and Download

License
mit
Access
Open weights, no gate
Download size
442.6 MB
Download from DaSciM

Released by DaSciM through its official repository on Hugging Face. Read the license.

Built From

  • Described by arXiv:2110.01485

Memory Requirements

PrecisionWeights in memory
As published442.6 MB
16-bit0.2 GB
8-bit0.1 GB
4-bit0.1 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About juribert-base

How much GPU memory does juribert-base need?

About 0.3 GB at 16-bit and 0.1 GB at 4-bit: the weights (111M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run juribert-base on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use juribert-base commercially?

Yes. juribert-base is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

What is juribert-base's context length?

512 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Fill mask

bert-base-uncased

BERT community

Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in this paper and first released in this repository. This model is uncased: it does not make a difference between english and English. Disclaimer: The team releasing BERT did not write a model card for this model so this model card has been written by the Hugging Face team. BERT is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labeling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from…

Open weights apache-2.0 110M parameters 512 tokens transformers

Model · Fill mask

camembert-base

ALMAnaCH (Inria)

CamemBERT is a state-of-the-art language model for French based on the RoBERTa model. It is now available on Hugging Face in 6 different versions with varying number of parameters, amount of pretraining data and pretraining data source domains. CamemBERT was trained and evaluated by Louis Martin\, Benjamin Muller\, Pedro Javier Ortiz Suárez\, Yoann Dupont, Laurent Romary, Éric Villemonte de la Clergerie, Djamé Seddah and Benoît Sagot. If you use our work, please cite

Open weights mit 111M parameters 514 tokens transformers

Eval data: Conll03 (NER), GermEval14 (NER), GermEval18 (Classification), GNAD (Classification) Update April 3rd, 2020: we updated the vocabulary file on deepset's s3 to conform with the default tokenization of punctuation tokens. For details see the related FARM issue. If you want to use the old vocab we have also uploaded a "deepset/bert-base-german-cased-oldvocab" model. - We trained using Google's Tensorflow code on a single cloud TPU v2 with standard settings. - We trained 810k steps with a batch size of 1024 for sequence length 128 and 30k steps with sequence length 512. Training took about 9 days. - As training data we used the latest German Wikipedia dump (6GB of raw txt files), the…

Open weights mit 110M parameters 512 tokens transformers

Model · Fill mask

bert-base-cased

BERT community

Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in this paper and first released in this repository. This model is case-sensitive: it makes a difference between english and English. Disclaimer: The team releasing BERT did not write a model card for this model so this model card has been written by the Hugging Face team. BERT is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from…

Open weights apache-2.0 109M parameters 512 tokens transformers

Model · Fill mask

bert-base-chinese

BERT community

This model has been pre-trained for Chinese, training and random input masking has been applied independently to word pieces (as in the original BERT paper). This model can be used for masked language modeling CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propagate historical and current stereotypes. Significant research has explored bias and fairness issues with language models (see, e.g., Sheng et al. (2021) and Bender et al. (2021)). typevocabsize: 2 vocabsize: 21128 numhiddenlayers: 12

Open weights apache-2.0 103M parameters 512 tokens transformers

Model · Fill mask

roberta-base

Facebook AI community

Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in this paper and first released in this repository. This model is case-sensitive: it makes a difference between english and English. Disclaimer: The team releasing RoBERTa did not write a model card for this model so this model card has been written by the Hugging Face team. RoBERTa is a transformers model pretrained on a large corpus of English data in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels…

Open weights mit 125M parameters 514 tokens transformers