Spaces:
Running
Running
Commit
·
6a6eef6
1
Parent(s):
6e873af
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import newspaper
|
3 |
+
from newspaper import Article
|
4 |
+
import nltk
|
5 |
+
nltk.download('punkt')
|
6 |
+
def art(url):
|
7 |
+
art=Article(url)
|
8 |
+
art.download()
|
9 |
+
art.parse()
|
10 |
+
art.nlp()
|
11 |
+
out=art.summary
|
12 |
+
return out
|
13 |
+
Demo = gr.Interface(fn=art,inputs='text',outputs='text',examples= [['https://www.hindustantimes.com/india-news/air-india-to-refund-full-amount-to-all-passengers-affected-by-delhi-san-francisco-flight-101686218402229.html']])
|
14 |
+
demo.launch()
|