Joaaaane's picture
Update README.md
fd68a18 verified
|
raw
history blame
5.08 kB
metadata
library_name: transformers
tags:
  - text summarization
license: apache-2.0
language:
  - en
metrics:
  - rouge
pipeline_tag: text2text-generation

Model Card for Post-Disaster Digital Help Desk Summarization Model

This model is designed to summarize digital help desk conversations in post-disaster scenarios, specifically tailored for non-profit organizations providing aid. It is based on the BART model, fine-tuned using parameter-efficient methods like LoRa adapters.

Model Details

Model Description

这是一个基于BART模型微调的parameter efficient finetuned model。使用的方法是LoRa adapter。这种模型专注于在灾后援助场景中对数字帮助台对话进行自动文本摘要,以提高信息收集的效率和质量,从而为受影响的人们提供及时有效的支持。

  • Developed by: [More Information Needed]
  • Funded by [optional]: [More Information Needed]
  • Shared by [optional]: [More Information Needed]
  • Model type: [More Information Needed]
  • Language(s) (NLP): [More Information Needed]

Uses

该模型旨在为非营利组织在灾后援助场景下的数字帮助台对话进行摘要,帮助desk的工作人员快速提炼关键信息,减少手动撰写高质量摘要的时间。

Bias, Risks, and Limitations

总结的摘要可能存在一定错误,如包含敏感信息,需要人工二次校正以确保准确性和隐私保护。

How to Get Started with the Model

Use the code below to get started with the model.

# install package
!pip install transformers[torch] -U
!pip install -q -U peft

import os
import torch
from google.colab import drive
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from huggingface_hub import notebook_login

# login to hugging_face
notebook_login() # use model on GPU
device = "cuda" if torch.cuda.is_available() else "cpu"

# load base model
model_name = "knkarthick/MEETING_SUMMARY"
model = AutoModelForSeq2SeqLM.from_pretrained(model_name).to(device)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# load trained adapter
adapter_id = "Joaaaane/510_ABW_LoRaAdapter_PostDisasterConv"
model.load_adapter(adapter_id) # set the model to evaluation mode
model.eval()
input_text = """
PA: Hello, I need urgent housing help as a refugee from Ukraine. Can you assist?
agent: Hello, thank you for reaching out to the Red Cross. We’re here to help with housing.
agent: Have you registered with the local authorities yet?
PA: Yes, but they mentioned delays, and we need something soon. It's urgent.
agent: We have temporary shelters available. How many are with you, and are there any special needs?
PA: It's just me and my elderly mother; we need accessible housing.
agent: We can arrange for accessible temporary shelter. I’ll expedite your request and aim to place you within a few days.
agent: I'll also connect you with a Ukrainian-speaking volunteer to help with your paperwork and make your mother more comfortable.
PA: Thank you so much. This help means a lot to us right now.
agent: You're welcome! Expect a call from our volunteer by tomorrow. We’ll make sure you both are settled quickly.
PA: Thanks again. Looking forward to resolving this soon.
"""

# tokenized inputs
inputs = tokenizer(input_text, return_tensors="pt", max_length=1024, truncation=True).to(device)
# generate summary tokens
outputs = model.generate(inputs['input_ids'], max_length=62, num_beams=5, early_stopping=True)
# decode tokens
summary = tokenizer.decode(outputs[0], skip_special_tokens=True)

print("Generated Summary:", summary)


## Training Details

### Training Data
Data provided by 510, an initiative of the Netherlands Red Cross (all confidential data has been masked).

### Testing Data
Data provided by 510, an initiative of the Netherlands Red Cross (all confidential data has been masked).

### Metrics
ROUGE Score

### Results
Before adapter: ROUGE 1: 22.50; ROUGE 2: 4.96; ROUGE L: 17.24  
After adding the adapter: ROUGE 1: 28.30; ROUGE 2: 8.64; ROUGE L: 22.50

## Technical Specifications

### Model Architecture and Objective
In post-disaster humanitarian assistance scenarios, the efficiency of digital help desks and the quality of the information they collect are crucial for providing effective and timely support to the people affected. This model leverages parameter-efficient fine-tuning techniques, including Low-Rank Adaptation (LoRA) and Prefix Tuning, to generate summaries and reduce the time spent on manually writing high-quality summaries. The results indicate that the adjusted LLMs not only improve the speed and quality of text summarization but also ensure adaptability to sensitive contexts. Potential challenges and recommendations for implementing the model in practice are also discussed.

## Citation

Base model: https://huggingface.co/knkarthick/MEETING_SUMMARY