Downloads · 30 days
25
2% of all-time downloads
Ketan3101/ConvoBrief
ConvoBrief is a summarization model from Ketan3101. Use it when you need a shorter version of a longer text. It is set up for peft.
This model is a variant of the facebook/bart-large-cnn model, enhanced with Low-Rank Adaptation (LoRA) for dialogue summarization tasks. LoRA employs Low-Rank Attention to facilitate feature aggregation across differe…
Downloads · 30 days
25
2% of all-time downloads
All-time downloads
1K
Public
Repo size
5.1 MB
Likes
1
Public
Click a slice to open those files.
.bin5.1 MB · 60%
From the Hugging Face model README
This model is a variant of the facebook/bart-large-cnn model, enhanced with Low-Rank Adaptation (LoRA) for dialogue summarization tasks. LoRA employs Low-Rank Attention to facilitate feature aggregation across different positions in the sequence, making it particularly effective for capturing the nuances of dialogues.
This model has been fine-tuned using the PEFT (Parameter-Efficient Fine-Tuning) approach, striking a balance between dialogue summarization objectives for optimal performance.
Deploy this LoRA-enhanced BART model for dialogue summarization tasks, leveraging the power of Low-Rank Adaptation to capture contextual dependencies in conversations. Generate concise and informative summaries from conversational text, enhancing your applications with enriched context-awareness.
from peft import PeftModel, PeftConfig
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from transformers import pipeline
# Load PeftConfig and base model
config = PeftConfig.from_pretrained("Ketan3101/ConvoBrief")
base_model = AutoModelForSeq2SeqLM.from_pretrained("facebook/bart-large-cnn")
# Load PeftModel
model = PeftModel.from_pretrained(base_model, "Ketan3101/ConvoBrief")
# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained("facebook/bart-large-cnn")
# Define a pipeline for dialogue summarization
summarization_pipeline = pipeline(
"summarization",
model=model,
tokenizer=tokenizer
)
# Example dialogue for summarization
dialogue = ["""
#Person1#: Happy Birthday, this is for you, Brian.
#Person2#: I'm so happy you remember, please come in and enjoy the party. Everyone's here, I'm sure you have a good time.
#Person1#: Brian, may I have a pleasure to have a dance with you?
#Person2#: Ok.
#Person1#: This is really wonderful party.
#Person2#: Yes, you are always popular with everyone. and you look very pretty today.
#Person1#: Thanks, that's very kind of you to say. I hope my necklace goes with my dress, and they both make me look good I feel.
#Person2#: You look great, you are absolutely glowing.
#Person1#: Thanks, this is a fine party. We should have a drink together to celebrate your birthday."""
]
# Combine dialogue into a single string
full_dialogue = " ".join(dialogue)
# Generate summary
summary = summarization_pipeline(full_dialogue, max_length=150, min_length=40, do_sample=True)
print("Original Dialogue:\n", full_dialogue)
print("Generated Summary:\n", summary[0]['summary_text'])