tanish78 commited on
Commit
bb89e53
·
verified ·
1 Parent(s): 764e1ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -40,7 +40,7 @@ categories_keywords_bot2 = {
40
  }
41
 
42
  # Initialize with Bot 1's categories
43
- categories_keywords = categories_keywords_bot1
44
 
45
  def categorize_question(question, categories_keywords):
46
  for category, keywords in categories_keywords.items():
@@ -174,7 +174,7 @@ def main(file, bot_name, num_clusters_to_display):
174
  else:
175
  categories_keywords = categories_keywords_bot2
176
 
177
- df = pd.read_csv(file)
178
 
179
  df = df[df['Answer'] == 'Fallback Message shown']
180
 
@@ -202,7 +202,7 @@ def main(file, bot_name, num_clusters_to_display):
202
  print(f"Error: {e}")
203
  return str(e), None, None
204
 
205
- def categorize_unanswered_queries(file, bot_name, num_clusters_to_display):
206
  return main(file, bot_name, num_clusters_to_display)
207
 
208
  interface = gr.Interface(
@@ -221,4 +221,4 @@ interface = gr.Interface(
221
  description="Select the bot, upload the CSV file, and specify the number of categories to display to categorize unanswered user queries."
222
  )
223
 
224
- interface.launch(share=True)
 
40
  }
41
 
42
  # Initialize with Bot 1's categories
43
+ categories_keywords = categories_keywords
44
 
45
  def categorize_question(question, categories_keywords):
46
  for category, keywords in categories_keywords.items():
 
174
  else:
175
  categories_keywords = categories_keywords_bot2
176
 
177
+ df = pd.read_csv(file.name)
178
 
179
  df = df[df['Answer'] == 'Fallback Message shown']
180
 
 
202
  print(f"Error: {e}")
203
  return str(e), None, None
204
 
205
+ def categorize_unanswered_queries(bot_name, file, num_clusters_to_display):
206
  return main(file, bot_name, num_clusters_to_display)
207
 
208
  interface = gr.Interface(
 
221
  description="Select the bot, upload the CSV file, and specify the number of categories to display to categorize unanswered user queries."
222
  )
223
 
224
+ interface.launch()