This model is fine-tuned on the
LexGLUE UNFAIR-ToS benchmark dataset to detect unfair clauses in Terms of Service documents.
Base Model: microsoft/deberta-base
Training: Standard BCEWithLogitsLoss, lr=3e-5, batch_size=8, linear scheduler, up to 20 epochs with early stopping (matching
Chalkidis et al., 2022)
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_id = "Agreemind/lexglue-deberta-unfair-tos"
5tokenizer = AutoTokenizer.from_pretrained(model_id)
6model = AutoModelForSequenceClassification.from_pretrained(model_id)
7
8labels = [
9 "Limitation of liability", "Unilateral termination",
10 "Unilateral change", "Content removal",
11 "Contract by using", "Choice of law",
12 "Jurisdiction", "Arbitration",
13]
14
15text = "We may terminate your account at any time without notice."
16inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=128)
17
18with torch.no_grad():
19 probs = torch.sigmoid(model(**inputs).logits).squeeze()
20
21for label, prob in sorted(zip(labels, probs), key=lambda x: x[1], reverse=True):
22 if prob > 0.5:
23 print(f" {label}: {prob:.3f}")
1@article{chalkidis2022lexglue,
2 title={LexGLUE: A Benchmark Dataset for Legal Language Understanding in English},
3 author={Chalkidis, Ilias and Jana, Abhik and Hartung, Dirk and Bommarito, Michael and Androutsopoulos, Ion and Katz, Daniel Martin and Aletras, Nikolaos},
4 journal={arXiv preprint arXiv:2110.00976},
5 year={2022}
6}