sotirios-slv commited on
Commit
fe13010
1 Parent(s): 77f0d19

Removed column names for the time being

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -37,7 +37,7 @@ def get_named_entities(ocr_text: str):
37
  def run(image, lang="eng"):
38
  print("Image ", image)
39
  try:
40
- print("Image filename ", image.filename)
41
  except Exception as e:
42
  print(f"Could not print image filename: {e}")
43
  result = pytesseract.image_to_string(image, lang=None if lang == [] else lang)
@@ -58,10 +58,8 @@ def download_output(ocr_text: str, named_entities: str, image_name="test"):
58
  ner_df = pd.Series(named_entities_list)
59
 
60
  with pd.ExcelWriter(output_file, engine="xlsxwriter") as writer:
61
- ocr_df.to_excel(writer, sheet_name="OCR text", columns=["OCR text"])
62
- ner_df.to_excel(
63
- writer, sheet_name="Named entities", columns=["Named entities"]
64
- )
65
  return output_file
66
 
67
  except Exception as e:
 
37
  def run(image, lang="eng"):
38
  print("Image ", image)
39
  try:
40
+ print("Image info ", image.info)
41
  except Exception as e:
42
  print(f"Could not print image filename: {e}")
43
  result = pytesseract.image_to_string(image, lang=None if lang == [] else lang)
 
58
  ner_df = pd.Series(named_entities_list)
59
 
60
  with pd.ExcelWriter(output_file, engine="xlsxwriter") as writer:
61
+ ocr_df.to_excel(writer, sheet_name="OCR text")
62
+ ner_df.to_excel(writer, sheet_name="Named entities")
 
 
63
  return output_file
64
 
65
  except Exception as e: