Update app.py
Browse files
app.py
CHANGED
@@ -450,7 +450,6 @@ def generate_sentiment_pie_chart(sentiment_history):
|
|
450 |
st.warning("No sentiment history available to generate a pie chart.")
|
451 |
return
|
452 |
|
453 |
-
# Initialize sentiment counts
|
454 |
sentiment_counts = {
|
455 |
"Positive": 0,
|
456 |
"Negative": 0,
|
@@ -458,14 +457,11 @@ def generate_sentiment_pie_chart(sentiment_history):
|
|
458 |
}
|
459 |
|
460 |
for entry in sentiment_history:
|
461 |
-
sentiment = entry["Sentiment"].capitalize()
|
462 |
if sentiment in sentiment_counts:
|
463 |
sentiment_counts[sentiment] += 1
|
464 |
else:
|
465 |
-
# Handle unknown sentiment values gracefully
|
466 |
st.warning(f"Unknown sentiment encountered: {entry['Sentiment']}")
|
467 |
-
|
468 |
-
# Create the pie chart (using matplotlib or any charting library)
|
469 |
labels = list(sentiment_counts.keys())
|
470 |
sizes = list(sentiment_counts.values())
|
471 |
colors = ['#6dcf6d', '#f76c6c', '#6c8df7']
|
@@ -544,7 +540,7 @@ def generate_post_call_summary(sentiment_history, recommendations=[]):
|
|
544 |
def main():
|
545 |
|
546 |
st.set_page_config(page_title="RealTime AI-Powered Sales Assistant", layout="wide")
|
547 |
-
st.title("🤖 RealTime AI-Powered Sales Assistant")
|
548 |
st.markdown(
|
549 |
"An intelligent assistant to analyze speech, handle objections, and recommend products in real-time."
|
550 |
)
|
|
|
450 |
st.warning("No sentiment history available to generate a pie chart.")
|
451 |
return
|
452 |
|
|
|
453 |
sentiment_counts = {
|
454 |
"Positive": 0,
|
455 |
"Negative": 0,
|
|
|
457 |
}
|
458 |
|
459 |
for entry in sentiment_history:
|
460 |
+
sentiment = entry["Sentiment"].capitalize()
|
461 |
if sentiment in sentiment_counts:
|
462 |
sentiment_counts[sentiment] += 1
|
463 |
else:
|
|
|
464 |
st.warning(f"Unknown sentiment encountered: {entry['Sentiment']}")
|
|
|
|
|
465 |
labels = list(sentiment_counts.keys())
|
466 |
sizes = list(sentiment_counts.values())
|
467 |
colors = ['#6dcf6d', '#f76c6c', '#6c8df7']
|
|
|
540 |
def main():
|
541 |
|
542 |
st.set_page_config(page_title="RealTime AI-Powered Sales Assistant", layout="wide")
|
543 |
+
st.title("🤖 RealTime AI-Powered Sales Assistant For Enhanced Conversation")
|
544 |
st.markdown(
|
545 |
"An intelligent assistant to analyze speech, handle objections, and recommend products in real-time."
|
546 |
)
|