Marthee commited on
Commit
089bf56
·
verified ·
1 Parent(s): 11ce43f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -226,7 +226,12 @@ def identify_headers_with_openrouter(pdf_path, model,LLM_prompt, pages_to_check=
226
  conf = float(obj.get('confidence') or 0)
227
  if t and page is not None:
228
  out.append({'text': t, 'page': page-1, 'suggested_level': level, 'confidence': conf})
229
-
 
 
 
 
 
230
  return out
231
 
232
  # Wrapper function to convert JSON to a dataframe-friendly format
 
226
  conf = float(obj.get('confidence') or 0)
227
  if t and page is not None:
228
  out.append({'text': t, 'page': page-1, 'suggested_level': level, 'confidence': conf})
229
+ df = pd.DataFrame(out)
230
+
231
+ # Save to Excel
232
+ df.to_excel("output.xlsx", index=False)
233
+
234
+ print("Saved JSON output to output.xlsx")
235
  return out
236
 
237
  # Wrapper function to convert JSON to a dataframe-friendly format