theatticusproject/cuad
Viewer • Updated • 84.3k • 7.99k • 50
Multi-label classifier flagging six risk-relevant clause types in commercial contracts, fine-tuned on CUAD v1.
Source and training code: https://github.com/ManasDasri/NNDL
| Index | Label |
|---|---|
| 0 | Cap on Liability |
| 1 | Non-Compete |
| 2 | License Grant |
| 3 | Audit Rights |
| 4 | Termination for Convenience |
| 5 | Insurance |
Six independent sigmoid outputs, not a softmax: contracts routinely carry several of these clause types at once.
Held-out test split, split by contract so no document appears in training.
| Label | Precision | Recall | F1 | Support |
|---|---|---|---|---|
| Cap on Liability | 0.760 | 0.731 | 0.745 | 104 |
| Non-Compete | 0.400 | 0.351 | 0.374 | 57 |
| License Grant | 0.806 | 0.767 | 0.786 | 146 |
| Audit Rights | 0.651 | 0.793 | 0.715 | 87 |
| Termination for Convenience | 0.491 | 0.540 | 0.514 | 50 |
| Insurance | 0.877 | 0.814 | 0.844 | 70 |
Chunk-level macro F1: 0.663 Document-level macro F1: 0.840 (max-pooled over windows)
Decision thresholds are tuned per label on the validation split rather than fixed at 0.5, because each label has its own positive rate. Using 0.5 will cost you recall.
| Label | Threshold |
|---|---|
| Cap on Liability | 0.78 |
| Non-Compete | 0.28 |
| License Grant | 0.32 |
| Audit Rights | 0.39 |
| Termination for Convenience | 0.22 |
| Insurance | 0.83 |
This is a TextCNN, not a transformers architecture, so there is no
from_pretrained for it. Load it with the training repository:
from legal_risk_classifier.runtime import CNNRuntime
runtime = CNNRuntime('path/to/this/download')
prediction = runtime.predict_document(contract_text)
print(prediction.predicted, prediction.document_scores)