Spaces:
Runtime error
Runtime error
commenting extracter and summarizer to check basic functionality of reading form a URL
Browse files
app.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
-
from newspaper import Article
|
| 2 |
-
from newspaper import Config
|
| 3 |
import nltk
|
| 4 |
nltk.download('punkt')
|
| 5 |
|
|
@@ -18,8 +17,14 @@ def extract_article_text(url):
|
|
| 18 |
text = article.text
|
| 19 |
return text
|
| 20 |
|
| 21 |
-
extractor = gr.Interface(
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
sample_url = [['https://www.technologyreview.com/2021/07/22/1029973/deepmind-alphafold-protein-folding-biology-disease-drugs-proteome/'],
|
| 25 |
['https://www.technologyreview.com/2021/07/21/1029860/disability-rights-employment-discrimination-ai-hiring/'],
|
|
@@ -32,8 +37,7 @@ desc = '''
|
|
| 32 |
'''
|
| 33 |
|
| 34 |
demo = gr.Interface (
|
| 35 |
-
|
| 36 |
-
summarizer,
|
| 37 |
inputs = gr.Textbox(
|
| 38 |
lines = 2,
|
| 39 |
label = 'URL'
|
|
|
|
| 1 |
+
from newspaper import Article, Config
|
|
|
|
| 2 |
import nltk
|
| 3 |
nltk.download('punkt')
|
| 4 |
|
|
|
|
| 17 |
text = article.text
|
| 18 |
return text
|
| 19 |
|
| 20 |
+
#extractor = gr.Interface(
|
| 21 |
+
# extract_article_text,
|
| 22 |
+
# 'text',
|
| 23 |
+
# 'text'
|
| 24 |
+
#)
|
| 25 |
+
#summarizer = gr.Interface.load(
|
| 26 |
+
# "huggingface/facebook/bart-large-cnn"
|
| 27 |
+
#)
|
| 28 |
|
| 29 |
sample_url = [['https://www.technologyreview.com/2021/07/22/1029973/deepmind-alphafold-protein-folding-biology-disease-drugs-proteome/'],
|
| 30 |
['https://www.technologyreview.com/2021/07/21/1029860/disability-rights-employment-discrimination-ai-hiring/'],
|
|
|
|
| 37 |
'''
|
| 38 |
|
| 39 |
demo = gr.Interface (
|
| 40 |
+
extract_article_text,
|
|
|
|
| 41 |
inputs = gr.Textbox(
|
| 42 |
lines = 2,
|
| 43 |
label = 'URL'
|