Hasitha16 commited on
Commit
d56816b
Β·
verified Β·
1 Parent(s): e280c8a

Update frontend.py

Browse files
Files changed (1) hide show
  1. 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("πŸ“ˆ 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,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("🧹 Clear"):
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("πŸ”¬ 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,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"):