Downloads · 30 days
8
9% of all-time downloads
Beelzi/legal-flan-t5-large-lora-2
legal-flan-t5-large-lora-2 is a summarization model from Beelzi. Use it when you need a shorter version of a longer text. It is set up for peft.
This model is a fine-tuned version of google/flan-t5-large using Low-Rank Adaptation (LoRA). It is specifically designed for the Indian legal domain to perform dual tasks: predicting the outcome of a legal case (Accep…
Downloads · 30 days
8
9% of all-time downloads
All-time downloads
86
Public
Repo size
2.6 GB
Likes
0
Public
Click a slice to open those files.
.pt1.8 GB · 63%
From the Hugging Face model README
This model is a fine-tuned version of google/flan-t5-large using Low-Rank Adaptation (LoRA). It is specifically designed for the Indian legal domain to perform dual tasks: predicting the outcome of a legal case (Accepted/Rejected) and generating a concise summary or explanation of the judgment.
This model acts as the predictive engine for Legal Text Summariser (LTS) applications. It ingests excerpts from Indian court cases (front and tail sections of the document) and outputs a structured response containing a discrete label and a brief generative explanation.
google/flan-t5-largeThe model is intended to be used by legal tech developers, researchers, and law students to:
It is optimized for integration into Retrieval-Augmented Generation (RAG) pipelines and decentralized security suites analyzing legal or compliance documents.
PredEx dataset.Use the code below to load the base model and the LoRA adapter for inference:
from transformers import T5ForConditionalGeneration, T5Tokenizer
from peft import PeftModel
import torch
# Load Base Model and Tokenizer
base_model_id = "google/flan-t5-large"
tokenizer = T5Tokenizer.from_pretrained(base_model_id)
base_model = T5ForConditionalGeneration.from_pretrained(base_model_id, device_map="auto")
# Load LoRA Adapter
peft_model_id = "Beelzi/legal-flan-t5-large-lora"
model = PeftModel.from_pretrained(base_model, peft_model_id)
# Inference Example
prompt = "Predict the legal outcome of this Indian court case. Output Label: 0 (rejected) or Label: 1 (accepted), then a brief explanation. Case: [INSERT CASE TEXT HERE]"
inputs = tokenizer(prompt, return_tensors="pt", max_length=512, truncation=True).to("cuda")
outputs = model.generate(**inputs, max_length=64)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))