EasyOCRExtractor
DashAI.back.models.RAG.extractors.EasyOCRExtractor
PDF text extractor using EasyOCR.
Converts PDF pages to images and runs OCR on each page. Works with any language supported by EasyOCR (80+ languages). No external system dependencies - pure pip install.
Parameters
- languages : array, default=
['en'] - Language codes for OCR (e.g. ['en'], ['es'], ['en','fr'])
- gpu : boolean, default=
True - Use GPU acceleration if available
Methods
extract(self, file_path: str) -> str
EasyOCRExtractorExtract text from PDF using EasyOCR.
get_credential(self, name: str)
ConfigObjectResolve a registered credential component by name.
Parameters
- name : str
- Credential component class name (e.g. "HuggingFaceCredential").
Returns
- BaseCredential
- An instance of the requested credential component.
get_metadata(cls) -> Dict[str, object]
BaseExtractorReturn metadata for registry — primarily supported_file_types.
get_schema(cls) -> dict
ConfigObjectGenerates the component related Json Schema.
Returns
- dict
- Dictionary representing the Json Schema of the component.
validate_and_transform(self, raw_data: dict) -> dict
ConfigObjectIt takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.
Parameters
- raw_data : dict
- A dictionary with the data provided by the user to initialize the model.
Returns
- dict
- A validated dictionary with the necessary objects.