Downloads · 30 days
0
Fafadalilian/lora-adapter-t5_small_model_California_state_bill
lora-adapter-t5_small_model_California_state_bill is a summarization model from Fafadalilian. Use it when you need a shorter version of a longer text. It is set up for transformers.
This model is a fine-tuned version of the T5-small model, enhanced with a LoRA (Low-Rank Adaptation) adapter. It has been specifically fine-tuned to summarize legal documents, focusing on California state bills.
Downloads · 30 days
0
Access
Public
Updated Aug 19, 2024
Repo size
2 MB
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 MB · 59%
From the Hugging Face model README
This model is a fine-tuned version of the T5-small model, enhanced with a LoRA (Low-Rank Adaptation) adapter. It has been specifically fine-tuned to summarize legal documents, focusing on California state bills.
Base Model: T5-small Task: Legal Document Summarization (California State Bills) LoRA Configuration: r: 8 lora_alpha: 32 lora_dropout: 0.1 Dataset: "billsum", split="ca_test"
Use the code below to get started with the model.
from transformers import T5Tokenizer, T5ForConditionalGeneration
# Load the model and tokenizer
tokenizer = T5Tokenizer.from_pretrained("Fafadalilian/lora-adapter-t5_small_model_California_state_bill")
model = T5ForConditionalGeneration.from_pretrained("Fafadalilian/lora-adapter-t5_small_model_California_state_bill")
# Example input text
input_text = "summarize: [Insert California state bill text here]"
# Tokenize the input
inputs = tokenizer(input_text, return_tensors="pt", truncation=True, padding="max_length", max_length=512)
# Generate summary
summary_ids = model.generate(inputs.input_ids, max_length=150, num_beams=2, length_penalty=2.0, early_stopping=True)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print("Summary:", summary)