Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ from nltk.sentiment.vader import SentimentIntensityAnalyzer
|
|
| 10 |
|
| 11 |
nltk.download('vader_lexicon')
|
| 12 |
|
| 13 |
-
st.set_page_config(page_title="Daily
|
| 14 |
st.title('Daily News with Sentiment Analysis')
|
| 15 |
|
| 16 |
# Sidebar inputs
|
|
@@ -130,8 +130,12 @@ if st.sidebar.button('Get News'):
|
|
| 130 |
df.drop(columns=['Cleaned_Title', 'Datetime', 'Source'], inplace=True)
|
| 131 |
df = df.reset_index(drop=True)
|
| 132 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
st.write(f"## News for {ticker}")
|
| 134 |
-
st.
|
| 135 |
|
| 136 |
# Option to download data as CSV
|
| 137 |
csv = df.to_csv(index=False).encode('utf-8')
|
|
|
|
| 10 |
|
| 11 |
nltk.download('vader_lexicon')
|
| 12 |
|
| 13 |
+
st.set_page_config(page_title="Daily News with Sentiment Analysis", layout="wide")
|
| 14 |
st.title('Daily News with Sentiment Analysis')
|
| 15 |
|
| 16 |
# Sidebar inputs
|
|
|
|
| 130 |
df.drop(columns=['Cleaned_Title', 'Datetime', 'Source'], inplace=True)
|
| 131 |
df = df.reset_index(drop=True)
|
| 132 |
|
| 133 |
+
# Make links clickable
|
| 134 |
+
df['Title'] = df.apply(lambda x: f'<a href="{x["Link"]}" target="_blank">{x["Title"]}</a>', axis=1)
|
| 135 |
+
df.drop(columns=['Link'], inplace=True)
|
| 136 |
+
|
| 137 |
st.write(f"## News for {ticker}")
|
| 138 |
+
st.markdown(df.to_html(escape=False, index=False), unsafe_allow_html=True)
|
| 139 |
|
| 140 |
# Option to download data as CSV
|
| 141 |
csv = df.to_csv(index=False).encode('utf-8')
|