abisee/cnn_dailymail
Viewer • Updated • 936k • 180k • 344
How to use plguillou/t5-base-fr-sum-cnndm with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "summarization" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline
pipe = pipeline("summarization", model="plguillou/t5-base-fr-sum-cnndm") # Load model directly
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("plguillou/t5-base-fr-sum-cnndm")
model = AutoModelForSeq2SeqLM.from_pretrained("plguillou/t5-base-fr-sum-cnndm")Version 1.0 (I will keep improving the model's performances.)
Version 2.0 is here! (with improved performances of course)
I trained the model on 13x more data than v1.
ROUGE-1: 44.5252
ROUGE-2: 22.652
ROUGE-L: 29.8866
This model is a T5 Transformers model (JDBN/t5-base-fr-qg-fquad) that was fine-tuned in french for abstractive text summarization.
from transformers import T5Tokenizer, T5ForConditionalGeneration
tokenizer = T5Tokenizer.from_pretrained("plguillou/t5-base-fr-sum-cnndm")
model = T5ForConditionalGeneration.from_pretrained("plguillou/t5-base-fr-sum-cnndm")
To summarize an ARTICLE, just modify the string like this : "summarize: ARTICLE".
The base model I used is JDBN/t5-base-fr-qg-fquad (it can perform question generation, question answering and answer extraction).
I used the "t5-base" model from the transformers library to translate in french the CNN / Daily Mail summarization dataset.