Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,6 @@ from streamlit_extras.add_vertical_space import add_vertical_space
|
|
6 |
from streamlit_mic_recorder import speech_to_text
|
7 |
from model_pipeline import ModelPipeLine
|
8 |
from q_learning_chatbot import QLearningChatbot
|
9 |
-
from retriever import create_vectorstore
|
10 |
|
11 |
from gtts import gTTS
|
12 |
from io import BytesIO
|
@@ -130,16 +129,7 @@ with input_container:
|
|
130 |
# Detect sentiment
|
131 |
user_sentiment = chatbot.detect_sentiment(query)
|
132 |
|
133 |
-
|
134 |
-
if user_sentiment in ["Negative", "Moderately Negative", "Neutral"]:
|
135 |
-
question = retriever.get_response(
|
136 |
-
user_message
|
137 |
-
)
|
138 |
-
st.session_state.asked_questions.append(question)
|
139 |
-
show_question = True
|
140 |
-
else:
|
141 |
-
show_question = False
|
142 |
-
question = ""
|
143 |
|
144 |
# Update mood history / mood_trend
|
145 |
chatbot.update_mood_history()
|
@@ -194,16 +184,7 @@ with input_container:
|
|
194 |
# Detect sentiment
|
195 |
user_sentiment = chatbot.detect_sentiment(query)
|
196 |
|
197 |
-
|
198 |
-
if user_sentiment in ["Negative", "Moderately Negative", "Neutral"]:
|
199 |
-
question = retriever.get_response(
|
200 |
-
user_message
|
201 |
-
)
|
202 |
-
st.session_state.asked_questions.append(question)
|
203 |
-
show_question = True
|
204 |
-
else:
|
205 |
-
show_question = False
|
206 |
-
question = ""
|
207 |
# Convert the response to speech
|
208 |
speech_fp = text_to_speech(response)
|
209 |
# Play the speech
|
|
|
6 |
from streamlit_mic_recorder import speech_to_text
|
7 |
from model_pipeline import ModelPipeLine
|
8 |
from q_learning_chatbot import QLearningChatbot
|
|
|
9 |
|
10 |
from gtts import gTTS
|
11 |
from io import BytesIO
|
|
|
129 |
# Detect sentiment
|
130 |
user_sentiment = chatbot.detect_sentiment(query)
|
131 |
|
132 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
# Update mood history / mood_trend
|
135 |
chatbot.update_mood_history()
|
|
|
184 |
# Detect sentiment
|
185 |
user_sentiment = chatbot.detect_sentiment(query)
|
186 |
|
187 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
# Convert the response to speech
|
189 |
speech_fp = text_to_speech(response)
|
190 |
# Play the speech
|