Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: OCRAgentTesseract() takes no arguments #3794

Open
AlexSkrn opened this issue Nov 23, 2024 · 0 comments
Open

TypeError: OCRAgentTesseract() takes no arguments #3794

AlexSkrn opened this issue Nov 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@AlexSkrn
Copy link

I am trying to run unstructured in Google Colab by following instructions from https://colab.research.google.com/drive/177-Tb6CJ0eFf9bZOEjbqb8xzR1IETpd-#scrollTo=huxQF-koB_8t

But getting this OCRAgentTesseract() takes no arguments error. The code used is provided below.

!apt-get -qq install poppler-utils tesseract-ocr
%pip install -q --user --upgrade pillow
%pip install -q unstructured["all-docs"]==0.12.5

import os
from unstructured.partition.pdf import partition_pdf

elements = partition_pdf(
filename=pdf_file,

# Unstructured Helpers
strategy="hi_res", 
infer_table_structure=True, 
model_name="yolox",
languages=["eng"]  # this line can be deleted and the same error pops up

)

/usr/local/lib/python3.10/dist-packages/unstructured/partition/utils/ocr_models/ocr_interface.py in get_instance(ocr_agent_module, language)
47 module_name, class_name = ocr_agent_module.rsplit(".", 1)
48 if module_name in OCR_AGENT_MODULES_WHITELIST:
---> 49 module = importlib.import_module(module_name)
50 loaded_class = getattr(module, class_name)
51 return loaded_class()

TypeError: OCRAgentTesseract() takes no arguments

@AlexSkrn AlexSkrn added the bug Something isn't working label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant