AnuragBodkhe commited on
Commit
f109ad5
·
verified ·
1 Parent(s): 1ffe1ed

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +145 -48
README.md CHANGED
@@ -1,13 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # ContractGuard Clause Classifier
2
 
3
  A fine-tuned Legal-BERT model for clause-level classification of contracts.
4
 
 
 
 
 
 
 
 
 
 
 
 
5
  ## Model Description
6
 
7
- This model is part of ContractGuard AI, a LegalTech platform for clause-level
8
- contract analysis.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
- The model classifies contract clauses into one of 40 predefined clause types.
11
 
12
  ## Intended Use
13
 
@@ -15,76 +66,122 @@ This model is intended for:
15
 
16
  - Contract clause classification
17
  - Legal document analysis
18
- - Contract intelligence systems
 
19
  - Clause-level downstream risk analysis
20
- - LegalTech research and applications
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
- The model is not intended to provide legal advice or legal conclusions.
 
23
 
24
- ## Model Details
25
 
26
- - Model version: 2.0
27
- - Architecture: Fine-tuned transformer encoder
28
- - Base model: nlpaueb/legal-bert-base-uncased
29
- - Task: Text classification
30
- - Number of clause types: 40
31
- - Domain: Legal contracts
32
- - Library: Transformers
 
 
 
33
 
34
  ## Training Data
35
 
36
- The model was trained using:
 
 
 
 
 
 
 
 
 
37
 
38
- - CUAD
39
- - LEDGAR
40
 
41
- Training and evaluation were performed using document-level splitting
42
- to reduce leakage between training and evaluation data.
 
 
 
 
 
 
 
 
43
 
44
  ## Evaluation
45
 
46
- Reported evaluation results for version 2.0:
47
 
48
- | Metric | Value |
49
  |---|---:|
50
- | Macro F1 | 0.8923 |
51
- | Expected Calibration Error (ECE) | 0.0391 |
 
 
 
 
 
52
 
53
- ## Output
 
54
 
55
- For each contract clause, the model produces a predicted clause type
56
- and a confidence score.
57
 
58
- ## Limitations
 
59
 
60
- The model's predictions should not be treated as legal conclusions.
 
61
 
62
- Performance may vary across:
63
 
64
- - Contract types
65
- - Jurisdictions
66
- - Drafting styles
67
- - Languages
68
- - Clauses outside the training distribution
69
 
70
- The model should be evaluated on the target population before being
71
- used in a production legal workflow.
72
 
73
- ## ContractGuard AI
 
74
 
75
- This model is one component of ContractGuard AI's multi-model architecture.
76
- Other components handle risk classification, legal NER, retrieval embeddings,
77
- and contract NLI.
78
 
79
- ## License
80
 
81
- This model is proprietary and hosted in a private repository.
82
 
83
- Unauthorized use, redistribution, or access is not permitted.
84
 
85
- ## Disclaimer
86
 
87
- Not legal advice. ContractGuard AI provides AI-assisted contract analysis
88
- for informational and decision-support purposes. Model predictions should
89
- not be treated as legal conclusions. Material decisions should be reviewed
90
- by a qualified professional in the relevant jurisdiction.
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: other
5
+ library_name: transformers
6
+ pipeline_tag: text-classification
7
+ base_model: nlpaueb/legal-bert-base-uncased
8
+ tags:
9
+ - legal-nlp
10
+ - legal-bert
11
+ - contract-analysis
12
+ - clause-classification
13
+ - legaltech
14
+ - text-classification
15
+ - contractguard
16
+ datasets:
17
+ - cuad
18
+ - ledgar
19
+ metrics:
20
+ - f1
21
+ ---
22
+
23
  # ContractGuard Clause Classifier
24
 
25
  A fine-tuned Legal-BERT model for clause-level classification of contracts.
26
 
27
+ This model is part of **ContractGuard AI**, a LegalTech platform designed to
28
+ analyze contracts at the clause level and provide AI-assisted contractual
29
+ risk analysis.
30
+
31
+ > **Not legal advice.** ContractGuard AI provides AI-assisted contract analysis
32
+ > for informational and decision-support purposes. Model outputs are predictions,
33
+ > not legal conclusions. Material decisions should be reviewed by a qualified
34
+ > professional in the relevant jurisdiction.
35
+
36
+ ---
37
+
38
  ## Model Description
39
 
40
+ The ContractGuard Clause Classifier is a fine-tuned transformer encoder designed
41
+ to classify individual contract clauses into predefined clause categories.
42
+
43
+ The model is used as the clause-classification component of the ContractGuard AI
44
+ multi-model architecture.
45
+
46
+ ### Model Details
47
+
48
+ | Property | Value |
49
+ |---|---|
50
+ | Model | ContractGuard Clause Classifier |
51
+ | Version | 2.0 |
52
+ | Task | Clause Classification |
53
+ | Architecture | Fine-tuned Transformer Encoder |
54
+ | Base Model | `nlpaueb/legal-bert-base-uncased` |
55
+ | Library | Hugging Face Transformers |
56
+ | Domain | Legal / Contract Documents |
57
+ | Language | English |
58
+ | Number of Clause Types | 40 |
59
+ | Model Format | Safetensors |
60
 
61
+ ---
62
 
63
  ## Intended Use
64
 
 
66
 
67
  - Contract clause classification
68
  - Legal document analysis
69
+ - Contract intelligence
70
+ - LegalTech applications
71
  - Clause-level downstream risk analysis
72
+ - Contract review assistance
73
+ - Research involving legal NLP and contract understanding
74
+
75
+ The model can be integrated into a larger contract-analysis pipeline where
76
+ clause classification is used as one input to subsequent analysis stages.
77
+
78
+ ---
79
+
80
+ ## How ContractGuard Uses This Model
81
+
82
+ ContractGuard AI uses multiple specialized models rather than relying on a
83
+ single model for every task.
84
+
85
+ The overall architecture contains separate components for:
86
+
87
+ 1. Clause classification
88
+ 2. Risk classification
89
+ 3. Legal Named Entity Recognition
90
+ 4. Retrieval embeddings
91
+ 5. Contract Natural Language Inference
92
+
93
+ This model is responsible specifically for **clause classification**.
94
 
95
+ The predicted clause type can subsequently be used by downstream components
96
+ for contractual risk analysis and rule evaluation.
97
 
98
+ ---
99
 
100
+ ## Classification Task
101
+
102
+ The model predicts **one of 40 predefined clause types** for an input contract
103
+ clause.
104
+
105
+ The predicted clause type is accompanied by a model confidence score.
106
+
107
+ The clause classification output is not itself a legal conclusion.
108
+
109
+ ---
110
 
111
  ## Training Data
112
 
113
+ The clause classifier was trained using:
114
+
115
+ - **CUAD**
116
+ - **LEDGAR**
117
+
118
+ The training pipeline uses document-level splitting rather than randomly
119
+ splitting individual clauses.
120
+
121
+ This is intended to reduce data leakage caused by clauses from the same
122
+ document appearing in both training and evaluation sets.
123
 
124
+ ---
 
125
 
126
+ ## Base Model
127
+
128
+ The model was fine-tuned from:
129
+
130
+ `nlpaueb/legal-bert-base-uncased`
131
+
132
+ Legal-BERT provides a transformer representation specialized for legal-domain
133
+ text, which is used as the foundation for this clause classification model.
134
+
135
+ ---
136
 
137
  ## Evaluation
138
 
139
+ ### Version 2.0 Results
140
 
141
+ | Metric | Result |
142
  |---|---:|
143
+ | Macro F1 | **0.8923** |
144
+ | Expected Calibration Error (ECE) | **0.0391** |
145
+
146
+ The model was evaluated on a held-out test split as part of the ContractGuard
147
+ training and evaluation pipeline.
148
+
149
+ ### Why Macro F1
150
 
151
+ Macro F1 gives equal weight to each class and is therefore useful when the
152
+ classification taxonomy contains classes with different frequencies.
153
 
154
+ ### Expected Calibration Error
 
155
 
156
+ ECE measures the difference between model confidence and observed accuracy
157
+ across confidence ranges.
158
 
159
+ It is used separately from the classification score because confidence and
160
+ classification performance represent different properties of the model.
161
 
162
+ ---
163
 
164
+ ## Version 2.0
 
 
 
 
165
 
166
+ ContractGuard Clause Classifier version 2.0 expanded training coverage by
167
+ combining CUAD with LEDGAR.
168
 
169
+ The project documentation reports that the earlier version had coverage
170
+ limitations across the full 40-class taxonomy.
171
 
172
+ Version 2.0 expanded coverage to additional clause types and was activated
173
+ only after comparison against the baseline on a real contract showed no
174
+ finding was lost.
175
 
176
+ ---
177
 
178
+ ## Input
179
 
180
+ The model expects legal/contractual text representing an individual clause.
181
 
182
+ Example:
183
 
184
+ ```text
185
+ The Contractor shall indemnify and hold harmless the Company from any claims,
186
+ losses, damages, liabilities, and expenses arising from the Contractor's
187
+ performance of the Services.