Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2259,12 +2259,13 @@ def testFunction(pdf_path, model,LLM_prompt):
|
|
| 2259 |
if subject in first_line or first_line in subject:
|
| 2260 |
entry["BodyText"] = entry["BodyText"][1:]
|
| 2261 |
|
| 2262 |
-
jsons.append(data_list_JSON)
|
| 2263 |
-
|
|
|
|
| 2264 |
logger.info(f"Uploaded and Readyy!")
|
| 2265 |
|
| 2266 |
|
| 2267 |
-
return
|
| 2268 |
|
| 2269 |
|
| 2270 |
|
|
@@ -2284,7 +2285,9 @@ def build_subject_body_map(jsons):
|
|
| 2284 |
def identify_headers_and_save_excel(pdf_path, model,LLM_prompt):
|
| 2285 |
try:
|
| 2286 |
# result = identify_headers_with_openrouterNEWW(pdf_path, model,LLM_prompt)
|
|
|
|
| 2287 |
jsons,result = testFunction(pdf_path, model,LLM_prompt)
|
|
|
|
| 2288 |
if not result:
|
| 2289 |
df = pd.DataFrame([{
|
| 2290 |
"text": None,
|
|
|
|
| 2259 |
if subject in first_line or first_line in subject:
|
| 2260 |
entry["BodyText"] = entry["BodyText"][1:]
|
| 2261 |
|
| 2262 |
+
# jsons.append(data_list_JSON)
|
| 2263 |
+
json_output = json.dumps(data_list_JSON, indent=4)
|
| 2264 |
+
logger.info(f"Markups done!")
|
| 2265 |
logger.info(f"Uploaded and Readyy!")
|
| 2266 |
|
| 2267 |
|
| 2268 |
+
return json_output,identified_headers
|
| 2269 |
|
| 2270 |
|
| 2271 |
|
|
|
|
| 2285 |
def identify_headers_and_save_excel(pdf_path, model,LLM_prompt):
|
| 2286 |
try:
|
| 2287 |
# result = identify_headers_with_openrouterNEWW(pdf_path, model,LLM_prompt)
|
| 2288 |
+
print('beginnging identify')
|
| 2289 |
jsons,result = testFunction(pdf_path, model,LLM_prompt)
|
| 2290 |
+
print('done , will start dataframe',jsons,result)
|
| 2291 |
if not result:
|
| 2292 |
df = pd.DataFrame([{
|
| 2293 |
"text": None,
|