rbawden commited on
Commit
8c1dc4f
·
1 Parent(s): 677f5d6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -1
README.md CHANGED
@@ -3,7 +3,7 @@ language: fr
3
  license: cc-by-4.0
4
  ---
5
 
6
- # Cour de Cassation *titrage* prediction model (transformer-base)
7
 
8
  Model for the automatic prediction of *titrages* (keyword sequence) from *sommaires* (synthesis of legal cases). The models are described in [this paper](https://hal.inria.fr/hal-03663110/file/LREC_2022___CCass_Inria-camera-ready.pdf). If you use this model, please cite our research paper (see [below](#cite)).
9
 
@@ -17,7 +17,18 @@ This model is to be used to produce *titrages* for those *sommaires* that do not
17
 
18
  ### How to use
19
 
 
 
 
 
 
20
 
 
 
 
 
 
 
21
 
22
 
23
  ### Limitations and bias
 
3
  license: cc-by-4.0
4
  ---
5
 
6
+ # Cour de Cassation automatic *titrage* prediction model
7
 
8
  Model for the automatic prediction of *titrages* (keyword sequence) from *sommaires* (synthesis of legal cases). The models are described in [this paper](https://hal.inria.fr/hal-03663110/file/LREC_2022___CCass_Inria-camera-ready.pdf). If you use this model, please cite our research paper (see [below](#cite)).
9
 
 
17
 
18
  ### How to use
19
 
20
+ ```
21
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
22
+
23
+ tokeniser = AutoTokenizer.from_pretrained("rbawden/CCASS-pred-titrages-base", use_auth_token=True)
24
+ model = AutoModelForSeq2SeqLM.from_pretrained("rbawden/CCASS-pred-titrages-base", use_auth_token=True)
25
 
26
+ matiere = "matter"
27
+ sommaire = "full text from the sommaire on a single line"
28
+ inputs = tokeniser([matiere + " <t> " + sommaire], return_tensors='pt')
29
+ outputs = model.generate(inputs['input_ids'])
30
+ tokeniser.batch_decode(outputs, skip_special_tokens=True, clean_up_tokenisation_spaces=True)
31
+ ```
32
 
33
 
34
  ### Limitations and bias