Spaces:
Running on Zero
Running on Zero
Download app/application/services/document_classifier.py from Zeyadmohamed21/OCR: direct link, hf CLI and curl.
- Browser
- Download file 347 Bytes
-
https://huggingface.co/spaces/Zeyadmohamed21/OCR/resolve/main/app/application/services/document_classifier.py
- Command line
-
hf download hf://spaces/Zeyadmohamed21/OCR/app/application/services/document_classifier.py
-
curl -L -o document_classifier.py https://huggingface.co/spaces/Zeyadmohamed21/OCR/resolve/main/app/application/services/document_classifier.py
347 Bytes
| from app.services.classification.classifier import UniversalDocumentClassifier | |
| class DocumentClassifier: | |
| """ | |
| Backwards-compatible wrapper delegating to UniversalDocumentClassifier. | |
| """ | |
| def classify(text: str) -> str: | |
| doc_type, _ = UniversalDocumentClassifier.classify(text) | |
| return doc_type | |