sharmax-vikas
commited on
Commit
•
6bffc77
1
Parent(s):
06c33c2
Update README.md
Browse files
README.md
CHANGED
@@ -82,4 +82,40 @@ The following hyperparameters were used during training:
|
|
82 |
- Datasets 2.20.0
|
83 |
- Tokenizers 0.19.1
|
84 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
|
|
|
82 |
- Datasets 2.20.0
|
83 |
- Tokenizers 0.19.1
|
84 |
|
85 |
+
### How to use model
|
86 |
+
```py
|
87 |
+
from transformers import pipeline
|
88 |
+
from random import randrange
|
89 |
+
|
90 |
+
|
91 |
+
summarizer = pipeline("summarization", model="sharmax-vikas/flan-t5-base-samsum", device=0)
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
print(f"dialogue: \n{sample['dialogue']}\n---------------")
|
96 |
+
|
97 |
+
res = summarizer(sample["dialogue"])
|
98 |
+
|
99 |
+
print(f"flan-t5-base summary:\n{res[0]['summary_text']}")
|
100 |
+
|
101 |
+
result = summarize('''Hannah: Hey, do you have Betty's number?
|
102 |
+
Amanda: Lemme check
|
103 |
+
Hannah: <file_gif>
|
104 |
+
Amanda: Sorry, can't find it.
|
105 |
+
Amanda: Ask Larry
|
106 |
+
Amanda: He called her last time we were at the park together
|
107 |
+
Hannah: I don't know him well
|
108 |
+
Hannah: <file_gif>
|
109 |
+
Amanda: Don't be shy, he's very nice
|
110 |
+
Hannah: If you say so..
|
111 |
+
Hannah: I'd rather you texted him
|
112 |
+
Amanda: Just text him 🙂
|
113 |
+
Hannah: Urgh.. Alright
|
114 |
+
Hannah: Bye
|
115 |
+
Amanda: Bye bye''')
|
116 |
+
|
117 |
+
print(result[0])
|
118 |
+
|
119 |
+
#{'summary_text': "Amanda can't find Betty's number. Amanda will ask Larry. Larry called Betty last time they were at the park together."}
|
120 |
+
```
|
121 |
|