Views
No views yet
1from transformers import pipeline
2
3summarizer = pipeline("summarization", model="Nicovis/ConvSum")
4
5
6DIALOGUE = """
7Linda: I'm going to have my room painted
8Linda: Can't decide what colors would best express my personality
9Linda: I'm considering advices, do you have one for me maybe? :)
10Brian: Fitting your personality... hmm
11Brian: I consider you an enthusiastic and lively person and the color for it is yellow
12Brian: On the other hand you can be calm and steady and they say those qualities are expressed in greyness
13Brian: So yellow & grey, how do you like the idea? :D
14Linda: Wow, I'm impressed!
15Linda: You've just paid me a compliment and come up with interesting colors!
16Brian: Well, those are actually facts :)
17Brian: Are you going to make use of the colors?
18Linda: Actually, I was planning to ask a few friends and then sum all the ideas up
19Linda: But now I think I don't need to do any further research
20Linda: Asking you for help was a bull's-eye! :D
21Brian: Perfection! :D
22Brian: I'll come and check the results of your work soon, it'll be a nice chance for us to talk :)
23Linda: Sure, feel invited!
24"""
25
26print(summarizer(DIALOGUE, max_length=64, min_length=30, do_sample=False))
27>>> [{'summary_text': "Linda is going to have her room painted. Brian recommends yellow and grey colors for her personality. Linda is going to make use of the colors. Brian will come and check the results of Linda's work soon."}]
281Seq2SeqTrainingArguments(
2 num_train_epochs= 5,
3 warmup_steps= 500,
4 per_device_train_batch_size= 16,
5 per_device_eval_batch_size= 16,
6 weight_decay= 0.1,
7 logging_steps= 10,
8 evaluation_strategy= steps,
9 eval_steps= 300,
10 save_steps= 1e6,
11 gradient_accumulation_steps= 16
12)| Metric | Average at the end of training |
|---|---|
| ROUGE-1 | 0.472 |
| ROUGE-2 | 0.241 |
| ROUGE-L | 0.376 |
| Cross entropy loss | 1.4 |
| Metric | Average at the of testing |
|---|---|
| ROUGE-1 | 0.496 |
| ROUGE-2 | 0.250 |
| ROUGE-L | 0.400 |
| BERTScore | 0.686 |