File size: 5,075 Bytes
c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 c50d2bd fd68a18 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
---
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
<!-- Provide a quick summary of what the model is/does. -->
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
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
该模型旨在为非营利组织在灾后援助场景下的数字帮助台对话进行摘要,帮助desk的工作人员快速提炼关键信息,减少手动撰写高质量摘要的时间。
## Bias, Risks, and Limitations
总结的摘要可能存在一定错误,如包含敏感信息,需要人工二次校正以确保准确性和隐私保护。
## How to Get Started with the Model
Use the code below to get started with the model.
```python
# 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 |