Views
No views yet
1from transformers import pipeline
2
3# Load summarization pipeline
4model_name = "avanishd/pegasus-finetuned-samsum/"
5summarizer = pipeline("summarization", model=model_name, tokenizer=model_name)
6
7# Sample conversation
8dialogue = """
9John: Hey, are you free tomorrow?
10Alice: I think so, why?
11John: Want to catch a movie or grab lunch?
12Alice: Sure, lunch sounds good. What time?
13John: Let's say 1 PM at the new place downtown?
14Alice: Works for me!
15"""
16
17# Generate summary
18summary = summarizer(dialogue, max_length=60, min_length=15, do_sample=False)[0]['summary_text']
19
20print("Summary:", summary)
21| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.5798 | 0.9992 | 920 | 1.4245 |