Spaces:
Sleeping
Sleeping
Update frontend.py
Browse files- frontend.py +5 -5
frontend.py
CHANGED
@@ -42,7 +42,7 @@ with st.sidebar:
|
|
42 |
"Web", "Android", "iOS", "Desktop", "Smartwatch", "Kiosk"
|
43 |
])
|
44 |
|
45 |
-
use_aspects = st.checkbox("
|
46 |
use_smart_summary = st.checkbox("π§ Use Smart Summary (clustered key points)")
|
47 |
use_smart_summary_bulk = st.checkbox("π§ Smart Summary for Bulk CSV")
|
48 |
|
@@ -78,7 +78,7 @@ with tab1:
|
|
78 |
st.session_state["review"] = "App was smooth, but the transaction failed twice on Android."
|
79 |
st.rerun()
|
80 |
with col3:
|
81 |
-
if st.button("
|
82 |
st.session_state["review"] = ""
|
83 |
st.rerun()
|
84 |
|
@@ -109,11 +109,11 @@ with tab1:
|
|
109 |
st.metric("π Sentiment", data["sentiment"]["label"], delta=f"{data['sentiment']['score']:.2%}")
|
110 |
st.info(f"π’ Emotion: {data['emotion']}")
|
111 |
if data.get("aspects"):
|
112 |
-
st.subheader("
|
113 |
for a in data["aspects"]:
|
114 |
st.write(f"πΉ {a['aspect']}: {a['sentiment']} ({a['score']:.2%})")
|
115 |
if data.get("follow_up"):
|
116 |
-
st.subheader("
|
117 |
st.warning(data["follow_up"])
|
118 |
else:
|
119 |
st.error(f"β API Error: {res.status_code}")
|
@@ -132,7 +132,7 @@ with tab2:
|
|
132 |
|
133 |
for col in ["industry", "product_category", "device"]:
|
134 |
if col not in df.columns:
|
135 |
-
df[col] = [""] * len(df)
|
136 |
df[col] = df[col].fillna("").astype(str)
|
137 |
|
138 |
if st.button("π Analyze Bulk Reviews"):
|
|
|
42 |
"Web", "Android", "iOS", "Desktop", "Smartwatch", "Kiosk"
|
43 |
])
|
44 |
|
45 |
+
use_aspects = st.checkbox("π Enable Aspect-Based Analysis")
|
46 |
use_smart_summary = st.checkbox("π§ Use Smart Summary (clustered key points)")
|
47 |
use_smart_summary_bulk = st.checkbox("π§ Smart Summary for Bulk CSV")
|
48 |
|
|
|
78 |
st.session_state["review"] = "App was smooth, but the transaction failed twice on Android."
|
79 |
st.rerun()
|
80 |
with col3:
|
81 |
+
if st.button("πΉοΈ Clear"):
|
82 |
st.session_state["review"] = ""
|
83 |
st.rerun()
|
84 |
|
|
|
109 |
st.metric("π Sentiment", data["sentiment"]["label"], delta=f"{data['sentiment']['score']:.2%}")
|
110 |
st.info(f"π’ Emotion: {data['emotion']}")
|
111 |
if data.get("aspects"):
|
112 |
+
st.subheader("π Aspects")
|
113 |
for a in data["aspects"]:
|
114 |
st.write(f"πΉ {a['aspect']}: {a['sentiment']} ({a['score']:.2%})")
|
115 |
if data.get("follow_up"):
|
116 |
+
st.subheader("π§ Follow-Up Response")
|
117 |
st.warning(data["follow_up"])
|
118 |
else:
|
119 |
st.error(f"β API Error: {res.status_code}")
|
|
|
132 |
|
133 |
for col in ["industry", "product_category", "device"]:
|
134 |
if col not in df.columns:
|
135 |
+
df[col] = ["Generic" if col == "industry" else ""] * len(df)
|
136 |
df[col] = df[col].fillna("").astype(str)
|
137 |
|
138 |
if st.button("π Analyze Bulk Reviews"):
|