Downloads · 30 days
20
1% of all-time downloads
openchs/sum-flan-t5-base-synthetic-v1
sum-flan-t5-base-synthetic-v1 is a summarization model from openchs. Use it when you need a shorter version of a longer text. The card lists the license as apache-2.0.
This model is a fine-tuned version of google/flan-t5-base specifically optimized for summarizing child helpline case call transcripts. It has been trained on domain-specific data to better understand and summarize con…
Downloads · 30 days
20
1% of all-time downloads
All-time downloads
1.5K
Public
Parameters
248M
991 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors990 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of google/flan-t5-base specifically optimized for summarizing child helpline case call transcripts. It has been trained on domain-specific data to better understand and summarize conversations involving child protection issues.
| Configuration | Value |
|---|---|
| Max Source Length | 1024 tokens |
| Max Target Length | 256 tokens |
| Training Epochs | 3 |
| Learning Rate | 3e-5 |
| Batch Size | 4 |
| Beam Search | 4 beams |
| Length Penalty | 2.0 |
| No Repeat N-gram | 2 |
from transformers import T5ForConditionalGeneration, T5Tokenizer
import torch
# Load model and tokenizer
model = T5ForConditionalGeneration.from_pretrained("openchs/sum-flan-t5-base-synthetic-v1")
tokenizer = T5Tokenizer.from_pretrained("openchs/sum-flan-t5-base-synthetic-v1")
# Generate summary
def generate_summary(text: str, max_length: int = 256) -> str:
input_text = f"Summarize the following child helpline case call transcript:{text}"
inputs = tokenizer(
input_text,
max_length=1024,
padding='max_length',
truncation=True,
return_tensors='pt'
)
with torch.no_grad():
outputs = model.generate(
input_ids=inputs['input_ids'],
attention_mask=inputs['attention_mask'],
max_length=max_length,
num_beams=4,
length_penalty=2.0,
early_stopping=True,
no_repeat_ngram_size=2
)
summary = tokenizer.decode(outputs[0], skip_special_tokens=True)
return summary
# Example usage
transcript = """
Hi, is this 116? Yes, thank you for calling. Who am I speaking to?
My name is John, I'm from Mwanza. I've got a serious concern about my 12-year-old sister.
She's being forced into child labor at a local factory...
"""
summary = generate_summary(transcript)
print(summary)
# Output: "John reported a case of child labor involving his 12-year-old sister in Mwanza.
# The counselor advised him to report it to the local Labor Office and police, with follow-up from the helpline."
Input: Complex transcript about 12-year-old forced into factory labor Output: "John reported a case of child labor involving his 12-year-old sister in Mwanza. The counselor advised him to report it to the local Labor Office and police, with follow-up from the helpline."
Input: Conversation about forced marriage prevention Output: "Mariam reported a case of child marriage involving her dad in Kisauni. The counselor advised reporting the issue to the children's office and police, and offered follow-up support."
The model was fine-tuned on a curated dataset of child helpline call transcripts, focusing on various child protection scenarios including:
This model is specifically designed for:
| Metric | Base FLAN-T5 | Fine-tuned Model | Improvement |
|---|---|---|---|
| ROUGE-1 | 0.342 | 0.518 | +51.5% |
| ROUGE-2 | 0.156 | 0.287 | +84.0% |
| ROUGE-L | 0.298 | 0.445 | +49.3% |
| BLEU-4 | 0.124 | 0.201 | +62.1% |
| BERTScore F1 | 0.731 | 0.856 | +17.1% |
| Semantic Similarity | 0.668 | 0.812 | +21.6% |
| Aspect | Base Model | Fine-tuned Model | Notes |
|---|---|---|---|
| Key Information Extraction | 68% | 91% | Caller name, location, issue type |
| Action Items Identification | 45% | 87% | Referrals, follow-up actions |
| Terminology Accuracy | 52% | 94% | Child protection specific terms |
| Summary Conciseness | 3.2/5 | 4.6/5 | Human evaluator rating |
| Factual Consistency | 71% | 89% | No hallucination of facts |
Evaluated by child protection professionals on 100 test cases
| Criteria | Base FLAN-T5 | Fine-tuned Model |
|---|---|---|
| Overall Quality | 2.8/5 | 4.4/5 |
| Professional Usability | 2.1/5 | 4.2/5 |
| Captures Essential Details | 2.9/5 | 4.5/5 |
| Appropriate Tone | 3.1/5 | 4.3/5 |
Compared to the base FLAN-T5 model, this fine-tuned version shows significant improvements across all evaluation metrics:
If you use this model in your research or applications, please cite:
@misc{flan-t5-child-helpline-summarizer,
title={Fine-tuned FLAN-T5 for Child Helpline Case Summarization},
author={openchs},
year={2024},
publisher={Hugging Face},
howpublished={\url{https://huggingface.co/openchs/sum-flan-t5-base-synthetic-v1}}
}
This model inherits the Apache 2.0 license from the base FLAN-T5 model. Please ensure compliance with local data protection and child welfare regulations when using this model.
For questions about this model or its applications in child protection work, please contact [[email protected]].
| Metric | Value |
|---|---|
| Rouge1 | 0.5804 |
| Rouge2 | 0.3623 |
| Rougel | 0.5325 |
| Train Loss | 0.8403 |
| Val Loss | 0.8031 |