Bofeng Huang
commited on
Commit
•
887c2c4
1
Parent(s):
18092fc
up
Browse files
README.md
CHANGED
@@ -18,3 +18,40 @@ should probably proofread and complete it, then remove this comment. -->
|
|
18 |
# Fine-tuned FLAN-T5 large model for French dialogue summarization
|
19 |
|
20 |
This model is a fine-tuned version of [google/flan-t5-large](https://huggingface.co/google/flan-t5-large) for French dialogue summarization.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
# Fine-tuned FLAN-T5 large model for French dialogue summarization
|
19 |
|
20 |
This model is a fine-tuned version of [google/flan-t5-large](https://huggingface.co/google/flan-t5-large) for French dialogue summarization.
|
21 |
+
|
22 |
+
## Usage
|
23 |
+
|
24 |
+
Inference with 🤗 Pipeline
|
25 |
+
|
26 |
+
```python
|
27 |
+
import torch
|
28 |
+
|
29 |
+
from datasets import load_dataset
|
30 |
+
from transformers import pipeline
|
31 |
+
|
32 |
+
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
33 |
+
|
34 |
+
pipe = pipeline(
|
35 |
+
"summarization",
|
36 |
+
model="bofenghuang/flan-t5-large-french-dialogue-summarization",
|
37 |
+
device=device,
|
38 |
+
)
|
39 |
+
|
40 |
+
dialogue_text = """
|
41 |
+
Pierre: J’ai oublié ma trousse. Tu peux me prêter un stylo.
|
42 |
+
Lucie: Tiens.
|
43 |
+
Pierre: Merci. Tu peux me donner une feuille de papier aussi ?
|
44 |
+
Lucie: Euh… oui. Tiens.
|
45 |
+
Pierre: Merci. Ça t’ennuie pas si je regarde avec toi ? J’ai oublié mon livre…
|
46 |
+
Lucie: Non, pas de problème.
|
47 |
+
Pierre: Pff. Je ne comprends rien. Tu pourras m’expliquer après le cours ?
|
48 |
+
Lucie: Oui, si tu veux… On ira au café.
|
49 |
+
Pierre: Oui… euh non, j’ai oublié mon porte-monnaie.
|
50 |
+
Lucie: Bon allez ! ce n’est pas grave, je t’invite.
|
51 |
+
Pierre: Tu es trop gentille.
|
52 |
+
Lucie: Oui, c’est bien possible.
|
53 |
+
"""
|
54 |
+
|
55 |
+
summarized_text = pipe(dialogue_text, max_length=1024)[0]["summary_text"] # greedy
|
56 |
+
# summarized_text = pipe(dialogue_text, max_length=1024, num_beams=5)[0]["summary_text"] # beam search
|
57 |
+
```
|
runs/Feb22_09-44-16_t2-90-gra7/events.out.tfevents.1677059389.t2-90-gra7.17204.0
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:9b15f4699d472b982c691decbe1a32cddad0e4fe132bbfa0356c520bc43994f9
|
3 |
-
size 488
|
|
|
|
|
|
|
|