Legal Text Processing
Specialized models for legal documents:
from transformers import pipeline
# Legal document classification
legal_classifier = pipeline(
"zero-shot-classification"
)
legal_documents = [
"The parties hereby agree to arbitrate all disputes arising under this agreement.",
"Tenant shall maintain liability insurance in the amount of $1,000,000.",
"This agreement shall be governed by the laws of the State of New York."
]
categories = ["Arbitration Clause", "Insurance Requirement", "Governing Law", "Termination Provision"]
for doc in legal_documents:
result = legal_classifier(doc, categories)
print(f"Text: {doc}")
print(f"Classification: {result['labels'][0]} (Score: {result['scores'][0]:.4f})")
print("-" * 50)