legal-llama-rag / load_caselaw.py
siyagajbhe's picture
Update load_caselaw.py
a8e8953 verified
raw
history blame contribute delete
612 Bytes
print("✅ Starting Space …")
from huggingface_hub import login
import os
from datasets import load_dataset
# ✅ Step 1: Authenticate
token = os.getenv("HF_TOKEN", "").strip()
login(token=token)
# ✅ Step 2: Load Caselaw dataset (small sample for testing)
print("🔍 Loading a small sample of the Caselaw dataset...")
ds = load_dataset("common-pile/caselaw_access_project", split="train[:100]")
# ✅ Step 3: Show results
for i, case in enumerate(ds):
print(f"\n📄 Case {i+1}:")
print("Case Name:", case.get("case_name", "N/A"))
print("Text Snippet:", case.get("text", "")[:300], "...")