Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -172,13 +172,13 @@ col1, col2 = st.columns(2)
|
|
| 172 |
with col1:
|
| 173 |
user_article_a = st.text_area("Data Source A", value=ARTICLE_A.strip(), height=220)
|
| 174 |
if st.button("Analyze A", use_container_width=True):
|
| 175 |
-
with st.spinner("Processing Source A.
|
| 176 |
st.session_state.results_a = analyze_article(user_article_a)
|
| 177 |
|
| 178 |
with col2:
|
| 179 |
user_article_b = st.text_area("Data Source B", value=ARTICLE_B.strip(), height=220)
|
| 180 |
if st.button("Analyze B", use_container_width=True):
|
| 181 |
-
with st.spinner("Processing Source B.
|
| 182 |
st.session_state.results_b = analyze_article(user_article_b)
|
| 183 |
|
| 184 |
st.write("")
|
|
@@ -199,7 +199,7 @@ if st.session_state.results_a or st.session_state.results_b:
|
|
| 199 |
st.plotly_chart(_create_sentiment_gauge(r_a["sentiment_score"], "Sentiment Bias"), use_container_width=True)
|
| 200 |
st.plotly_chart(_create_tone_bar_chart(r_a["tone_scores"]), use_container_width=True)
|
| 201 |
|
| 202 |
-
st.markdown("**Key Framing
|
| 203 |
annotated_text = _highlight_keywords(user_article_a, r_a["keywords"])
|
| 204 |
st.markdown(f"<div style='background-color: #f8fafc; padding: 1rem; border-radius: 8px; border: 1px solid #e2e8f0;'>{annotated_text}</div>", unsafe_allow_html=True)
|
| 205 |
|
|
@@ -214,6 +214,6 @@ if st.session_state.results_a or st.session_state.results_b:
|
|
| 214 |
st.plotly_chart(_create_sentiment_gauge(r_b["sentiment_score"], "Sentiment Bias"), use_container_width=True)
|
| 215 |
st.plotly_chart(_create_tone_bar_chart(r_b["tone_scores"]), use_container_width=True)
|
| 216 |
|
| 217 |
-
st.markdown("**Key Framing
|
| 218 |
annotated_text = _highlight_keywords(user_article_b, r_b["keywords"])
|
| 219 |
st.markdown(f"<div style='background-color: #f8fafc; padding: 1rem; border-radius: 8px; border: 1px solid #e2e8f0;'>{annotated_text}</div>", unsafe_allow_html=True)
|
|
|
|
| 172 |
with col1:
|
| 173 |
user_article_a = st.text_area("Data Source A", value=ARTICLE_A.strip(), height=220)
|
| 174 |
if st.button("Analyze A", use_container_width=True):
|
| 175 |
+
with st.spinner("Processing Source A."):
|
| 176 |
st.session_state.results_a = analyze_article(user_article_a)
|
| 177 |
|
| 178 |
with col2:
|
| 179 |
user_article_b = st.text_area("Data Source B", value=ARTICLE_B.strip(), height=220)
|
| 180 |
if st.button("Analyze B", use_container_width=True):
|
| 181 |
+
with st.spinner("Processing Source B."):
|
| 182 |
st.session_state.results_b = analyze_article(user_article_b)
|
| 183 |
|
| 184 |
st.write("")
|
|
|
|
| 199 |
st.plotly_chart(_create_sentiment_gauge(r_a["sentiment_score"], "Sentiment Bias"), use_container_width=True)
|
| 200 |
st.plotly_chart(_create_tone_bar_chart(r_a["tone_scores"]), use_container_width=True)
|
| 201 |
|
| 202 |
+
st.markdown("**Key Framing Language:**")
|
| 203 |
annotated_text = _highlight_keywords(user_article_a, r_a["keywords"])
|
| 204 |
st.markdown(f"<div style='background-color: #f8fafc; padding: 1rem; border-radius: 8px; border: 1px solid #e2e8f0;'>{annotated_text}</div>", unsafe_allow_html=True)
|
| 205 |
|
|
|
|
| 214 |
st.plotly_chart(_create_sentiment_gauge(r_b["sentiment_score"], "Sentiment Bias"), use_container_width=True)
|
| 215 |
st.plotly_chart(_create_tone_bar_chart(r_b["tone_scores"]), use_container_width=True)
|
| 216 |
|
| 217 |
+
st.markdown("**Key Framing Language:**")
|
| 218 |
annotated_text = _highlight_keywords(user_article_b, r_b["keywords"])
|
| 219 |
st.markdown(f"<div style='background-color: #f8fafc; padding: 1rem; border-radius: 8px; border: 1px solid #e2e8f0;'>{annotated_text}</div>", unsafe_allow_html=True)
|