sims2k commited on
Commit
2454d5c
1 Parent(s): 7b233f5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +78 -172
README.md CHANGED
@@ -1,206 +1,112 @@
1
  ---
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
 
 
9
 
 
10
 
 
11
 
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
 
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
 
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
 
153
- ## Technical Specifications [optional]
154
 
155
- ### Model Architecture and Objective
 
 
 
 
 
 
156
 
157
- [More Information Needed]
 
 
 
 
 
158
 
159
- ### Compute Infrastructure
160
 
161
- [More Information Needed]
162
 
163
- #### Hardware
164
 
165
- [More Information Needed]
166
 
167
- #### Software
168
 
169
- [More Information Needed]
170
 
171
- ## Citation [optional]
172
 
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
 
 
 
 
 
174
 
175
- **BibTeX:**
 
 
 
176
 
177
- @misc{colombo2024saullm7b,
178
- title={SaulLM-7B: A pioneering Large Language Model for Law},
179
- author={Pierre Colombo and Telmo Pessoa Pires and Malik Boudiaf and Dominic Culver and Rui Melo and Caio Corro and Andre F. T. Martins and Fabrizio Esposito and Vera Lúcia Raposo and Sofia Morgado and Michael Desa},
180
- year={2024},
181
- eprint={2403.03883},
182
- archivePrefix={arXiv},
183
- primaryClass={cs.CL}
184
- }
185
 
186
- **APA:**
187
 
188
- [More Information Needed]
189
 
190
- ## Glossary [optional]
 
 
 
 
191
 
192
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
193
 
194
- [More Information Needed]
195
 
196
- ## More Information [optional]
 
 
 
197
 
198
- [More Information Needed]
199
 
200
- ## Model Card Authors [optional]
201
 
202
- [More Information Needed]
203
 
204
- ## Model Card Contact
 
 
 
205
 
206
- [More Information Needed]
 
1
  ---
2
  library_name: transformers
3
+ tags:
4
+ - GDPR
5
+ - Law
6
+ - English
7
+ - Data Protection
8
+ license: mit
9
+ datasets:
10
+ - sims2k/GDPR_QA_instruct_dataset
11
+ language:
12
+ - en
13
+ metrics:
14
+ - bleu
15
+ - rouge
16
+ - meteor
17
+ - bertscore
18
+ base_model: Equall/Saul-7B-Instruct-v1
19
  ---
20
 
21
+ ## **Model Overview**
22
 
23
+ **Model Name**: Equall/Saul-7B-Instruct-GDPR-v1
24
+ **Base Model**: Equall/Saul-7B-Instruct-v1
25
+ **Finetuning Method**: QLoRA (Quantized Low-Rank Adaptation)
26
 
27
+ Equall/Saul-7B-Instruct-GDPR-v1 is a fine-tuned version of the Equall/Saul-7B-Instruct-v1 model, specifically optimized for handling **GDPR compliance tasks**. The model is designed to generate accurate, legally grounded responses aligned with the General Data Protection Regulation (GDPR). It supports various compliance-related tasks such as data audits, legal advisory, and ensuring adherence to GDPR requirements for data controllers and processors.
28
 
29
+ ---
30
 
31
+ ## **GDPR Task Focus**
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
 
33
+ The model is optimized to address detailed queries related to GDPR compliance, providing step-by-step instructions aligned with relevant GDPR articles. Below is an example illustrating how the model approaches a specific GDPR task related to conducting a Data Protection Impact Assessment (DPIA):
34
 
35
+ ### Example Task: Conducting a Data Protection Impact Assessment (DPIA)
36
+ Input: What are the benefits of conducting a DPIA?
 
 
 
37
 
38
+ **Input**: What are the benefits of conducting a DPIA?
39
 
40
+ **Response**:
41
+ <cite> Conducting a **Data Protection Impact Assessment (DPIA)** provides several benefits in ensuring GDPR compliance:
42
+ 1. **Identifying Risks**: DPIAs help identify and mitigate risks to individuals’ rights and freedoms by evaluating potential impacts on personal data processing activities.
43
+ 2. **Accountability**: DPIAs demonstrate compliance with **GDPR Article 24(1)**, which requires controllers to implement appropriate technical and organizational measures to ensure and maintain data protection.
44
+ 3. **Building Compliance**: Through a structured approach, DPIAs facilitate building compliance by identifying necessary measures for processing activities.
45
+ 4. **Legal Basis**: A DPIA can serve as a legal basis for processing personal data, especially when dealing with special categories of data or large-scale monitoring (referencing **Article 6(1)(c)** and **Article 9(2)(i)**).
46
+ 5. **Regulatory Compliance**: Meeting DPIA requirements helps prevent fines imposed by supervisory authorities for non-compliance with GDPR articles, including **Articles 35(1), (3)-(4)**, **Article 35(2)**, **Article 35(7)-(9)**, and **Article 36(3)(e)**.
47
 
48
+ **Relevant GDPR Articles**:
49
+ - **Article 35** (DPIA requirements)
50
+ - **Article 24** (Accountability of controllers)
51
+ - **Article 6(1)(c)** (Legal basis for processing)
52
+ - **Article 9(2)(i)** (Processing of special categories of data)
53
+ - **Article 36(3)(e)** (Consultation with supervisory authorities)</cite>
54
 
55
+ This demonstrates the model's capacity to generate structured, article-specific responses that assist organizations in navigating GDPR compliance tasks.
56
 
57
+ ---
58
 
59
+ ## **Fine-Tuning Methodology**
60
 
61
+ The fine-tuning of this model was conducted using **QLoRA** (Quantized Low-Rank Adaptation) to optimize model efficiency and accuracy, particularly when handling legal texts. QLoRA enabled the fine-tuning process to maintain a high level of performance while significantly reducing the computational load by quantizing the model weights to 4-bit precision.
62
 
63
+ Training was conducted using the **bwUniCluster 2.0 computing facility**, utilizing **Tesla V100 GPUs** for efficient training over multiple iterations. Each iteration aimed to improve the model’s capacity to understand and generate responses to GDPR-specific inquiries by referencing the appropriate articles of the regulation.
64
 
65
+ ---
66
 
67
+ ## **Datasets**
68
 
69
+ ### **1. Training Dataset**
70
+ **Dataset Name**: sims2k/GDPR_QA_instruct_dataset
71
+ - **Number of Entries**: 316 Question-Answer pairs
72
+ - **Creation Method**: This dataset was synthetically generated using **ChatGPT-4** to create specialized Q&A pairs focused on GDPR compliance tasks. The dataset was carefully crafted by synthesizing information from trusted sources, including **GDPR articles**, **Legal FAQs**, and **Guidelines, Recommendations, and Best Practices from the European Data Protection Board (EDPB)**.
73
+ - **Advanced Prompt Engineering** techniques were employed, including **one-shot** and **chain-of-thought prompting**, to create precise, contextually relevant responses. The output generation was controlled using a **temperature setting of zero**, ensuring determinism and reliability in the responses.
74
+ - Each dataset entry was fact-checked for accuracy and cross-referenced with the related GDPR articles, ensuring legal validity and practical utility in real-world settings.
75
 
76
+ ### **2. Evaluation Dataset**
77
+ **Dataset Name**: sims2k/GDPR_QA_instruct_eval_dataset
78
+ - **Number of Entries**: 63 Question-Answer pairs
79
+ - **Description**: This evaluation dataset was designed to rigorously test the model's ability to generalize its learning. Each entry focuses on unseen GDPR queries, ensuring the model’s ability to respond accurately to new contexts. The dataset was evaluated using advanced NLP metrics like **ROUGE**, **BLEU**, **METEOR**, and **BERTScore**, which help measure the structural and semantic quality of the responses.
80
 
81
+ ---
 
 
 
 
 
 
 
82
 
83
+ ## **Performance Metrics**
84
 
85
+ The model’s performance was assessed using advanced NLP metrics to evaluate both the quality of generated text and the adherence to legal standards in GDPR queries.
86
 
87
+ ### **Metrics Used**:
88
+ 1. **BLEU**: Measures precision by calculating n-gram overlap between the generated response and the reference text.
89
+ 2. **ROUGE**: Focuses on recall, assessing how much of the reference content is captured in the generated response.
90
+ 3. **METEOR**: Combines both precision and recall, weighting recall more heavily and evaluating the quality of text alignment.
91
+ 4. **BERTScore**: Uses contextual embeddings to compare the generated and reference texts, focusing on semantic coherence.
92
 
93
+ The results are presented in the **Composite Scores for All Evaluated Models** graph below, showcasing the model’s performance across these metrics.
94
 
95
+ **(Insert the "Composite Scores for All Evaluated Models" Graph Here)**
96
 
97
+ ### **Understanding the Graph**:
98
+ - **Higher Composite Scores** represent a stronger performance in generating accurate, legally valid, and contextually appropriate responses.
99
+ - **Normalization** was applied to all metrics using **Min-Max scaling**, ensuring an equal contribution of each metric to the final score.
100
+ - **Equal Weighting** was used across metrics to provide a balanced assessment of the model’s capabilities.
101
 
102
+ ---
103
 
104
+ ## **Limitations and Future Work**
105
 
106
+ Despite its strong performance in GDPR compliance tasks, the model may face challenges in handling **edge cases** or **complex legal nuances**. The model's accuracy could further be improved by expanding the dataset to include additional legal scenarios and by incorporating domain-specific datasets from other regulatory frameworks.
107
 
108
+ Future improvements will focus on:
109
+ - Expanding the dataset size and diversity.
110
+ - Conducting more fine-tuning iterations to address subtle legal interpretations.
111
+ - Potentially integrating legal reasoning from other regulatory domains beyond GDPR.
112