Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,6 @@ import nltk
|
|
6 |
import os
|
7 |
import PyPDF2
|
8 |
|
9 |
-
|
10 |
# Load summarization pipeline
|
11 |
summarizer = pipeline("summarization", model="harao-ml/flant5-finetuned-summarize")
|
12 |
|
@@ -99,6 +98,7 @@ def summarize_file(file):
|
|
99 |
# Function to fetch top headlines from NewsAPI and summarize them
|
100 |
def fetch_news():
|
101 |
url = 'https://newsapi.org/v2/top-headlines'
|
|
|
102 |
params = {
|
103 |
'apiKey': api_key,
|
104 |
'language': 'en',
|
|
|
6 |
import os
|
7 |
import PyPDF2
|
8 |
|
|
|
9 |
# Load summarization pipeline
|
10 |
summarizer = pipeline("summarization", model="harao-ml/flant5-finetuned-summarize")
|
11 |
|
|
|
98 |
# Function to fetch top headlines from NewsAPI and summarize them
|
99 |
def fetch_news():
|
100 |
url = 'https://newsapi.org/v2/top-headlines'
|
101 |
+
api_key = os.environ.get("api_key")
|
102 |
params = {
|
103 |
'apiKey': api_key,
|
104 |
'language': 'en',
|