Spaces:
Sleeping
Sleeping
Commit ·
fe13010
1
Parent(s): 77f0d19
Removed column names for the time being
Browse files36 unmodified lines3738394041424314 unmodified lines5859606162636465666736 unmodified linesdef run(image, lang="eng"):print("Image ", image)try:print("Image filename ", image.filename)except Exception as e:print(f"Could not print image filename: {e}")result = pytesseract.image_to_string(image, lang=None if lang == [] else lang)14 unmodified linesner_df = pd.Series(named_entities_list)with pd.ExcelWriter(output_file, engine="xlsxwriter") as writer:ocr_df.to_excel(writer, sheet_name="OCR text", columns=["OCR text"])ner_df.to_excel(writer, sheet_name="Named entities", columns=["Named entities"])return output_fileexcept Exception as e:36 unmodified lines3738394041424314 unmodified lines585960616263646536 unmodified linesdef run(image, lang="eng"):print("Image ", image)try:print("Image info ", image.info)except Exception as e:print(f"Could not print image filename: {e}")result = pytesseract.image_to_string(image, lang=None if lang == [] else lang)14 unmodified linesner_df = pd.Series(named_entities_list)with pd.ExcelWriter(output_file, engine="xlsxwriter") as writer:ocr_df.to_excel(writer, sheet_name="OCR text")ner_df.to_excel(writer, sheet_name="Named entities")return output_fileexcept Exception as e:
app.py+3-5