Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,10 @@ os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
|
|
21 |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
22 |
|
23 |
# Ensure necessary NLTK resources are downloaded
|
24 |
-
|
|
|
|
|
|
|
25 |
|
26 |
# Initialize the stemmer
|
27 |
stemmer = LancasterStemmer()
|
@@ -177,7 +180,7 @@ with gr.Blocks() as demo:
|
|
177 |
message_input = gr.Textbox(label="Your Message", placeholder="Type a message here...", lines=4)
|
178 |
location_input = gr.Textbox(label="Your Location", placeholder="Enter your location (e.g., Pune, India)...", lines=2)
|
179 |
health_query_input = gr.Textbox(label="Health Professional Search", placeholder="Type a health professional type (e.g., therapist, doctor)...", lines=1)
|
180 |
-
history_output = gr.Chatbot(label="Chat History"
|
181 |
sentiment_output = gr.Textbox(label="Sentiment Analysis")
|
182 |
emotion_output = gr.Textbox(label="Emotion Detection")
|
183 |
suggestions_output = gr.Dataframe(label="Suggestions", headers=["Title", "Subject", "Link"], interactive=True)
|
|
|
21 |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
22 |
|
23 |
# Ensure necessary NLTK resources are downloaded
|
24 |
+
try:
|
25 |
+
nltk.download('punkt')
|
26 |
+
except Exception as e:
|
27 |
+
print(f"Error downloading NLTK data: {e}")
|
28 |
|
29 |
# Initialize the stemmer
|
30 |
stemmer = LancasterStemmer()
|
|
|
180 |
message_input = gr.Textbox(label="Your Message", placeholder="Type a message here...", lines=4)
|
181 |
location_input = gr.Textbox(label="Your Location", placeholder="Enter your location (e.g., Pune, India)...", lines=2)
|
182 |
health_query_input = gr.Textbox(label="Health Professional Search", placeholder="Type a health professional type (e.g., therapist, doctor)...", lines=1)
|
183 |
+
history_output = gr.Chatbot(label="Chat History", scale=3)
|
184 |
sentiment_output = gr.Textbox(label="Sentiment Analysis")
|
185 |
emotion_output = gr.Textbox(label="Emotion Detection")
|
186 |
suggestions_output = gr.Dataframe(label="Suggestions", headers=["Title", "Subject", "Link"], interactive=True)
|