Spaces:
Sleeping
Sleeping
Merge pull request #2 from StateLibraryVictoria/export-file-fixes
Browse filesFiles changed (3)
16 unmodified lines17181920212216 unmodified lineslfs: true- name: Push to hubenv:HF_TOKEN: ${{ secrets.HF_TOKEN }}run: git push https://HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/sotirios-slv/theatre-programmer-dev main16 unmodified lines17181920212216 unmodified lineslfs: true- name: Push to hubenv:HF_TOKEN: ${{ secrets.HF_DEV_TOKEN }}run: git push https://HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/sotirios-slv/theatre-programmer-dev main
16 unmodified lines1718192016 unmodified lines- name: Push to hubenv:HF_TOKEN: ${{ secrets.HF_TOKEN }}run: git push https://HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/sotirios-slv/theatre-programmer main16 unmodified lines1718192016 unmodified lines- name: Push to hubenv:HF_TOKEN: ${{ secrets.HF_TOKEN }}run: git push https://HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/sotirios-slv/theatre-programmer main
35 unmodified lines363738394041429 unmodified lines5253545556575859606162636435 unmodified linesdef run(image, lang="eng"):print("Image ", image)print("Image type ", type(image))result = pytesseract.image_to_string(image, lang=None if lang == [] else lang)ner = get_named_entities(result)9 unmodified linesoutput_file = f"{image_name}_{datetime_now}.xlsx"ocr_df = pd.Series(ocr_text)print("OCR ", ocr_df)ner_df = pd.Series(named_entities_list)print("NER ", ner_df)with pd.ExcelWriter(output_file) 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:35 unmodified lines363738394041424344459 unmodified lines55565758596061626364656667686970717235 unmodified linesdef run(image, lang="eng"):print("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)9 unmodified linesoutput_file = f"{image_name}_{datetime_now}.xlsx"ocr_df = pd.Series(ocr_text)ner_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_fileexcept Exception as e:
.github/workflows/deploy-to-hf-dev.yml+1-1
.github/workflows/deploy-to-hf-prod.yml+1-1
app.py+13-5