qq1023 commited on
Commit
48cef06
·
1 Parent(s): 9b5fb59

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -184,7 +184,7 @@ def process_and_output_files(input_files):
184
  # Extract and categorize text for each file
185
  text = extract_text(file)
186
  category = categorize_text(text)
187
- chatbot_response = query(category, text)
188
  parsed_info = parse(category, chatbot_response)
189
 
190
  # Append the relevant data for this file to the output_data list
@@ -192,13 +192,14 @@ def process_and_output_files(input_files):
192
  "File Name": file.name,
193
  "Extracted Text": text,
194
  "Category": category,
195
- "Chatbot Response": chatbot_response[0][1],
196
  "Parsed Information": parsed_info,
197
  })
198
 
199
  return output_data
200
 
201
 
 
202
  with gr.Blocks(title="Automatic Reimbursement Tool Demo") as page:
203
  gr.Markdown("<center><h1>Automatic Reimbursement Tool Demo</h1></center>")
204
  gr.Markdown("<h2>Description</h2>")
 
184
  # Extract and categorize text for each file
185
  text = extract_text(file)
186
  category = categorize_text(text)
187
+ chatbot_response = list(query(category, text)) # Convert the generator to a list
188
  parsed_info = parse(category, chatbot_response)
189
 
190
  # Append the relevant data for this file to the output_data list
 
192
  "File Name": file.name,
193
  "Extracted Text": text,
194
  "Category": category,
195
+ "Chatbot Response": chatbot_response[0][1], # Access the first element as a list
196
  "Parsed Information": parsed_info,
197
  })
198
 
199
  return output_data
200
 
201
 
202
+
203
  with gr.Blocks(title="Automatic Reimbursement Tool Demo") as page:
204
  gr.Markdown("<center><h1>Automatic Reimbursement Tool Demo</h1></center>")
205
  gr.Markdown("<h2>Description</h2>")