Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -57,8 +57,8 @@ segments = load_and_preprocess_text(filename)
|
|
57 |
|
58 |
def find_relevant_segment(user_query, segments):
|
59 |
"""
|
60 |
-
Find the most relevant text segment for a user's query using cosine similarity among sentence embeddings.
|
61 |
-
This version finds the best match based on the content of the query.
|
62 |
"""
|
63 |
try:
|
64 |
# Lowercase the query for better matching
|
@@ -82,7 +82,7 @@ This version finds the best match based on the content of the query.
|
|
82 |
|
83 |
def generate_response(user_query, relevant_segment):
|
84 |
"""
|
85 |
-
Generate a response emphasizing the bot's capability in providing information about St. Louis events.
|
86 |
"""
|
87 |
try:
|
88 |
system_message = "You are a chatbot specialized in providing information on local events, pro-Palestine movements, and community outreach, pride movements/events and community resources."
|
|
|
57 |
|
58 |
def find_relevant_segment(user_query, segments):
|
59 |
"""
|
60 |
+
Find the most relevant text segment for a user's query using cosine similarity among sentence embeddings.
|
61 |
+
This version finds the best match based on the content of the query.
|
62 |
"""
|
63 |
try:
|
64 |
# Lowercase the query for better matching
|
|
|
82 |
|
83 |
def generate_response(user_query, relevant_segment):
|
84 |
"""
|
85 |
+
Generate a response emphasizing the bot's capability in providing information about St. Louis events.
|
86 |
"""
|
87 |
try:
|
88 |
system_message = "You are a chatbot specialized in providing information on local events, pro-Palestine movements, and community outreach, pride movements/events and community resources."
|