đ bart-base-cnn-swe
This model is a work in progress, designed for text summarization tasks. It offers a practical solution for quickly generating summaries from text data.
đ Quick Start
from transformers import pipeline
summarizer = pipeline("summarization", model="Gabriel/bart-base-cnn-swe")
ARTICLE = """
France's lock Sebastien Chabal has been cited for a dangerous tackle on England's Simon Shaw during Saturday's World Cup semi-final in Paris. Simon Shaw was carried off despite Raphael Ibanez (left) and Sebastien Chabal. Sale Sharks forward will face a disciplinary inquiry on Monday after his tackle on opposing second-rower Shaw was noted by citing commissioner Dennis Wheelahan. Chabal started the match on the bench but came on in the 26th minute to replace the injured Fabien Pelous during hosts France's 14-9 defeat. If he is suspended, Chabal will miss Friday's third and fourth matches at the Parc des Princes. Meanwhile, France coach Bernard Laporte said the defeat was harder to take than England's 24-7 win in the 2003 semi-final. "In 2003, they were better than us. In fact, they were better than everyone," said Laporte, who is leaving his role to take up the post of junior sports minister in the French government. "They were like New Zealand in this tournament - the favorites, except they went all the way. This time it's harder because yesterday it was 50-50." Meanwhile, England - trying to become the first nation to defend the World Cup title - revealed that star kicker Jonny Wilkinson again had problems with the match balls during the semi-final. Fly-half, who expressed his concern after struggling with the boot against Australia, knocked a ball away before kicking a vital three-pointer against France. "We didn't say it last week, but a non-match ball came onto the field in Marseille that Jonny kicked," rugby chief Rob Andrew said. "He didn't think about it when he kicked it. The match balls are marked, numbered one to six. Last night they had 'World Cup semi-final England vs France' written on them. On match night, Jonny was aware when he kicked for goal that they were actually match balls he was kicking. 'Training balls lose pressure and shape. The whole issue last week, the organizers agreed all six match balls should be used by both sides on Thursday before the match.' Email to a friend.
"""
print(summarizer(ARTICLE, max_length=130, min_length=30, num_beams=10 ,do_sample=False))
>>> [{'summary_text': """ France's lock Sebastien Chabal has been cited for a dangerous tackle on England's Simon Shaw during the World Cup semi-final in Paris. Sale Sharks forward will face a disciplinary inquiry on Monday after his tackle on opposing second - rower Shaw was noted by citing commissioner Dennis Wheelahan. If Chabal is suspended, he will miss Friday's third and fourth matches at the Parc des Princes."""}]
⨠Features
- Transformer-based: BART is a transformer encoder-encoder (seq2seq) model with a bidirectional (BERT-like) encoder and an autoregressive (GPT-like) decoder.
- Fine-tuned: This model is a fine-tuned version of KBLab/bart-base-swedish-cased on the Gabriel/bart-base-cnn-swe dataset.
- Summarization: It can be used for summarization tasks.
đ Documentation
Model description
BART is a transformer encoder-encoder (seq2seq) model with a bidirectional (BERT-like) encoder and an autoregressive (GPT-like) decoder. BART is pre-trained by (1) corrupting text with an arbitrary noising function, and (2) learning a model to reconstruct the original text. This model is a fine-tuned version of KBLab/bart-base-swedish-cased on the Gabriel/bart-base-cnn-swe dataset and can be used for summarization tasks.
Intended uses & limitations
This model should only be used to fine-tune further on and summarization tasks.
đ§ Technical Details
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-05
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- gradient_accumulation_steps: 2
- total_train_batch_size: 16
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 2*2 = 4
- mixed_precision_training: Native AMP
Training results
Training Loss |
Epoch |
Step |
Validation Loss |
Rouge1 |
Rouge2 |
Rougel |
Rougelsum |
Gen Len |
2.2349 |
1.0 |
17944 |
2.0643 |
21.9564 |
10.2133 |
17.9958 |
20.6502 |
19.9992 |
2.0726 |
2.0 |
35888 |
2.0253 |
22.0568 |
10.3302 |
18.0648 |
20.7482 |
19.9996 |
1.8658 |
3.0 |
53832 |
2.0333 |
22.0871 |
10.2902 |
18.0577 |
20.7082 |
19.998 |
1.8121 |
4.0 |
71776 |
1.9759 |
22.2046 |
10.4332 |
18.1753 |
20.846 |
19.9971 |
Framework versions
- Transformers 4.22.1
- Pytorch 1.12.1+cu113
- Datasets 2.4.0
- Tokenizers 0.12.1
đ License
This project is licensed under the MIT License.