Spaces:
Sleeping
Sleeping
Commit ·
4286a1e
1
Parent(s): cd373fc
Updated the excel export
Browse files37 unmodified lines383940414243444512 unmodified lines585960616263646566676869707137 unmodified linesprint("Image ", image)try:print("Image filename ", image.filename)except:print("Could not print image filename")result = pytesseract.image_to_string(image, lang=None if lang == [] else lang)ner = get_named_entities(result)12 unmodified linesner_df = pd.Series(named_entities_list)with pd.ExcelWriter(output_file) as writer:ocr_df.to_excel(writer, sheet_name="OCR text", columns=["OCR text"], index=False)ner_df.to_excel(writer,sheet_name="Named entities",columns=["Named entities"],index=False,)return output_file37 unmodified lines383940414243444512 unmodified lines58596061626364656637 unmodified linesprint("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)ner = get_named_entities(result)12 unmodified linesner_df = pd.Series(named_entities_list)with pd.ExcelWriter(output_file) 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_file
app.py+4-9