Bin ZHANG
commited on
Commit
•
e8e594d
1
Parent(s):
2d0afc8
lets go
Browse files
app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
-
summarizer = pipeline("summarization"
|
4 |
|
5 |
def translate(text):
|
6 |
text = text.replace(""",'"').replace("'","'").replace("&","&")
|
7 |
-
result = summarizer(text,min_length=180,truncation=True)
|
8 |
return result[0]["summary_text"]
|
9 |
|
10 |
iface = gr.Interface(fn=translate,
|
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
+
summarizer = pipeline("summarization")
|
4 |
|
5 |
def translate(text):
|
6 |
text = text.replace(""",'"').replace("'","'").replace("&","&")
|
7 |
+
result = summarizer(text,min_length=180,truncation=True,clean_up_tokenization_spaces=True)
|
8 |
return result[0]["summary_text"]
|
9 |
|
10 |
iface = gr.Interface(fn=translate,
|