Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -135,16 +135,21 @@ def main():
|
|
135 |
# Parse the advanced analysis response
|
136 |
analysis_data = parse_analysis(advanced_msg)
|
137 |
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
st.write(
|
|
|
|
|
|
|
|
|
|
|
148 |
|
149 |
# Display the sentiment in a collapsible section
|
150 |
with st.expander("Show Sentiment"):
|
|
|
135 |
# Parse the advanced analysis response
|
136 |
analysis_data = parse_analysis(advanced_msg)
|
137 |
|
138 |
+
if "error" in analysis_data:
|
139 |
+
st.error("Error in analysis: " + analysis_data["error"])
|
140 |
+
if "details" in analysis_data:
|
141 |
+
st.error("Details: " + analysis_data["details"])
|
142 |
+
else:
|
143 |
+
# Display parsed data in a collapsible section
|
144 |
+
with st.expander("Show Advanced Analysis"):
|
145 |
+
st.write("### User Intent")
|
146 |
+
st.write(analysis_data['user_intent'])
|
147 |
+
st.write("### Follow-up Questions")
|
148 |
+
for question in analysis_data['follow_up_questions']:
|
149 |
+
st.write("- " + question)
|
150 |
+
st.write("### Identified Entities")
|
151 |
+
for entity_type, entities in analysis_data['entities'].items():
|
152 |
+
st.write(f"**{entity_type.capitalize()}**: {', '.join(entities)}")
|
153 |
|
154 |
# Display the sentiment in a collapsible section
|
155 |
with st.expander("Show Sentiment"):
|