DarshanMM commited on
Commit
6f18e3d
·
1 Parent(s): 8e022d2

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #python3
2
+ #build a text summarizer using hugging face and gradio
3
+
4
+ import gradio as gr
5
+ import pandas as pd
6
+ import numpy as np
7
+ from transformers import pipeline
8
+
9
+ def summarize(text):
10
+ summarizer = pipeline("summarization")
11
+ return summarizer(text, max_length=512)[0]['summary_text']
12
+
13
+ iface = gr.Interface(summarize, "textbox", "label")
14
+ if __name__ == "__main__":
15
+ iface.launch()