Views
No views yet
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 1.6026 | 0.5431 | 500 | 1.4875 |
| 1.4737 | 1.0861 | 1000 | 1.4040 |
| 1.4735 | 1.6292 | 1500 | 1.3839 |
| rouge1 | rouge2 | rougeL | rougeLsum Loss |
|---|---|---|---|
| 0.427614 | 0.200571 | 0.340648 | 0.340738 |
1from transformers import pipeline
2import torch
3
4device = 0 if torch.cuda.is_available() else -1
5pipe = pipeline("summarization",
6 model="seddiktrk/pegasus-samsum",
7 device=device)
8
9custom_dialogue = """\
10Seddik: Hey, have you tried using PEGASUS for summarization?
11John: Yeah, I just started experimenting with it last week!
12Seddik: It's pretty powerful, especially for abstractive summaries.
13John: I agree! The results are really impressive.
14Seddik: I was thinking of using it for my next project. Want to collaborate?
15John: Absolutely! We could make some awesome improvements together.
16Seddik: Perfect, let's brainstorm ideas this weekend.
17John: Sounds like a plan!
18"""
19
20# Summarize dialogue
21gen_kwargs = {"length_penalty": 0.8, "num_beams":8, "max_length": 128}
22print(pipe(custom_dialogue, **gen_kwargs)[0]["summary_text"])John started using PEG for summarization last week. Seddik is thinking of using it for his next project.
John and Seddik will brainstorm ideas this weekend.