Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -255,15 +255,15 @@ def analyze_document(document_text, api_key):
|
|
255 |
overall_time = time.time() - overall_start_time
|
256 |
print(f"[LOG] Document analysis completed in {overall_time:.2f} seconds")
|
257 |
|
258 |
-
topics_summary = "DOCUMENT ANALYSIS SUMMARY:\n"
|
259 |
-
topics_summary += f"Total segments: {len(results)}\n"
|
260 |
-
topics_summary += f"Processing time: {overall_time:.2f} seconds\n\n"
|
261 |
-
topics_summary += "SEGMENTS:\n"
|
262 |
|
263 |
-
for segment in results:
|
264 |
-
|
265 |
|
266 |
-
formatted_output = topics_summary + "\n" + formatted_output
|
267 |
|
268 |
return formatted_output, json_path, txt_path
|
269 |
except Exception as e:
|
|
|
255 |
overall_time = time.time() - overall_start_time
|
256 |
print(f"[LOG] Document analysis completed in {overall_time:.2f} seconds")
|
257 |
|
258 |
+
# topics_summary = "DOCUMENT ANALYSIS SUMMARY:\n"
|
259 |
+
# topics_summary += f"Total segments: {len(results)}\n"
|
260 |
+
# topics_summary += f"Processing time: {overall_time:.2f} seconds\n\n"
|
261 |
+
# topics_summary += "SEGMENTS:\n"
|
262 |
|
263 |
+
# for segment in results:
|
264 |
+
# topics_summary += f"- Segment {segment['segment_number']}: {segment['topic_name']}\n"
|
265 |
|
266 |
+
# formatted_output = topics_summary + "\n" + formatted_output
|
267 |
|
268 |
return formatted_output, json_path, txt_path
|
269 |
except Exception as e:
|