JACOBBBB commited on
Commit
194e320
1 Parent(s): d54dc57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -24,10 +24,6 @@ if st.button("Analyze and Respond"):
24
  label = sentiment_result['label']
25
  score = sentiment_result['score']
26
 
27
- # Display the sentiment analysis result
28
- st.write("Predicted Sentiment:", label)
29
- st.write("Confidence Score:", f"{score * 100:.2f}%")
30
-
31
  # Generate the response text
32
  response_text = f"The sentiment of the review is {label} with a confidence of {score * 100:.2f} percent."
33
 
@@ -35,8 +31,12 @@ if st.button("Analyze and Respond"):
35
  audio = text_to_audio(response_text)
36
  st.audio(audio['audio'], format='audio/wav', sample_rate=audio['sampling_rate'])
37
 
 
 
 
 
38
  # Generate a professional response based on the review and its sentiment
39
- prompt = f"The guest has left a {label} review stating: '{review}'. Thank you for sharing your experience. We "
40
  professional_response = response_generator(prompt, max_length=150, num_return_sequences=1)[0]['generated_text']
41
 
42
  # Display the generated professional response
 
24
  label = sentiment_result['label']
25
  score = sentiment_result['score']
26
 
 
 
 
 
27
  # Generate the response text
28
  response_text = f"The sentiment of the review is {label} with a confidence of {score * 100:.2f} percent."
29
 
 
31
  audio = text_to_audio(response_text)
32
  st.audio(audio['audio'], format='audio/wav', sample_rate=audio['sampling_rate'])
33
 
34
+ # Display the sentiment analysis result
35
+ st.write("Predicted Sentiment:", label)
36
+ st.write("Confidence Score:", f"{score * 100:.2f}%")
37
+
38
  # Generate a professional response based on the review and its sentiment
39
+ prompt = f"Thank you for sharing your experience. We "
40
  professional_response = response_generator(prompt, max_length=150, num_return_sequences=1)[0]['generated_text']
41
 
42
  # Display the generated professional response