File size: 2,540 Bytes
1e7c1ac bf236d3 1e7c1ac bf236d3 1e7c1ac bf236d3 1e7c1ac 77ea62b 1e7c1ac e49fba9 bf236d3 e49fba9 1e7c1ac e49fba9 1e7c1ac 40b6489 1e7c1ac bf236d3 1e7c1ac bf236d3 1e7c1ac bf236d3 1e7c1ac bf236d3 1e7c1ac bf236d3 1e7c1ac bf236d3 1e7c1ac 5106c20 40b6489 5106c20 1e7c1ac 5106c20 0956f7b 5106c20 0956f7b 5106c20 0956f7b 5106c20 1e7c1ac |
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 |
---
library_name: transformers
tags:
- summarization
- dialogue
---
# Model Card for phi-2-dialogsum
<!-- Provide a quick summary of what the model is/does. -->
This model is designed for **dialogue summarization**. It takes multi-turn conversations as input and produces concise summaries.
## Model Details
### Model Description
This is the model card for **phi-2-dialogsum**, a dialogue summarization model built on top of 🤗 Transformers. It leverages phi-2 backbone model, fine-tuned for summarizing dialogues.
- **Developed by:** Aygün Varol & Malik Sami
- **Model type:** Generative Language Model
- **Language(s) (NLP):** English
- **License:** MIT
- **Finetuned from model:** [Phi-2](https://huggingface.co/microsoft/phi-2)
### Model Sources
- **Repository (GitHub):** [AygunVarol/phi-2-dialogsum](https://github.com/AygunVarol/phi-2-dialogsum)
## Uses
### Direct Use
This model can be used directly for **dialogue summarization** tasks. For example, given a multi-turn conversation, the model will produce a succinct summary capturing the key information and context.
## How to Get Started with the Model
Below is a quick code snippet to load and run inference with this model:
```python
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
model_name = "YourHuggingFaceUsername/phi-2-dialogsum" # replace with the correct HF model ID
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
input_text = """Speaker1: Hi, how are you doing today?
Speaker2: I'm good, thanks! Just finished my coffee.
Speaker1: That's nice. Did you sleep well last night?
Speaker2: Actually, I slept quite late watching a new show on Netflix."""
inputs = tokenizer([input_text], max_length=512, truncation=True, return_tensors="pt")
summary_ids = model.generate(**inputs, max_length=60, num_beams=4, early_stopping=True)
summary = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print("Summary:", summary)
```
## Training Details
Training dataset [Dialogsum](https://huggingface.co/datasets/neil-code/dialogsum-test)
## Evaluation
ORIGINAL MODEL:
{'rouge1': 0.2990526195120211, 'rouge2': 0.10874019046839419, 'rougeL': 0.21186900909813286, 'rougeLsum': 0.22342464591439556}
PEFT MODEL:
{'rouge1': 0.3132817683433486, 'rouge2': 0.1070363134080079, 'rougeL': 0.23226760188839027, 'rougeLsum': 0.25947902747914586}
## Absolute percentage improvement of PEFT MODEL over ORIGINAL MODEL
rouge1: 1.42%
rouge2: -0.17%
rougeL: 2.04%
rougeLsum: 3.61%
|