Spaces:
Runtime error
Runtime error
Download extractor.py from Mr-Vicky-01/Legal-Doc-Analyzer: direct link, hf CLI and curl.
- Browser
- Download file 325 Bytes
-
https://huggingface.co/spaces/Mr-Vicky-01/Legal-Doc-Analyzer/resolve/main/extractor.py
- Command line
-
hf download hf://spaces/Mr-Vicky-01/Legal-Doc-Analyzer/extractor.py
-
curl -L -o extractor.py https://huggingface.co/spaces/Mr-Vicky-01/Legal-Doc-Analyzer/resolve/main/extractor.py
325 Bytes
| from PyPDF2 import PdfReader | |
| # PDF Handler Class | |
| class PDFHandler: | |
| def __init__(self) -> None: | |
| pass | |
| def read_pdf(file): | |
| pdf_reader = PdfReader(file) | |
| text = "" | |
| for page in pdf_reader.pages: | |
| text += page.extract_text() | |
| return text |