|
--- |
|
license: apache-2.0 |
|
language: fr |
|
library_name: transformers |
|
thumbnail: null |
|
tags: |
|
- summarization |
|
widget: |
|
- text: "" |
|
metrics: |
|
- rouge |
|
model-index: |
|
- name: Fine-tuned FLAN-T5 large model for French dialogue summarization |
|
results: [] |
|
--- |
|
|
|
<!-- This model card has been generated automatically according to the information the Trainer had access to. You |
|
should probably proofread and complete it, then remove this comment. --> |
|
|
|
# Fine-tuned FLAN-T5 large model for French dialogue summarization |
|
|
|
This model is a fine-tuned version of [google/flan-t5-large](https://huggingface.co/google/flan-t5-large) for French dialogue summarization. |
|
|
|
## Usage |
|
|
|
Inference with 🤗 Pipeline |
|
|
|
```python |
|
import torch |
|
|
|
from datasets import load_dataset |
|
from transformers import pipeline |
|
|
|
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") |
|
|
|
pipe = pipeline( |
|
"summarization", |
|
model="bofenghuang/flan-t5-large-french-dialogue-summarization", |
|
device=device, |
|
) |
|
|
|
dialogue_text = """ |
|
Pierre: J’ai oublié ma trousse. Tu peux me prêter un stylo. |
|
Lucie: Tiens. |
|
Pierre: Merci. Tu peux me donner une feuille de papier aussi ? |
|
Lucie: Euh… oui. Tiens. |
|
Pierre: Merci. Ça t’ennuie pas si je regarde avec toi ? J’ai oublié mon livre… |
|
Lucie: Non, pas de problème. |
|
Pierre: Pff. Je ne comprends rien. Tu pourras m’expliquer après le cours ? |
|
Lucie: Oui, si tu veux… On ira au café. |
|
Pierre: Oui… euh non, j’ai oublié mon porte-monnaie. |
|
Lucie: Bon allez ! ce n’est pas grave, je t’invite. |
|
Pierre: Tu es trop gentille. |
|
Lucie: Oui, c’est bien possible. |
|
""" |
|
|
|
summarized_text = pipe(dialogue_text, max_length=1024)[0]["summary_text"] # greedy |
|
# summarized_text = pipe(dialogue_text, max_length=1024, num_beams=5)[0]["summary_text"] # beam search |
|
``` |