Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import PyPDF2
|
| 3 |
+
from PIL import Image
|
| 4 |
+
import pytesseract
|
| 5 |
+
|
| 6 |
+
# Directory for storing PDF resumes and job applications
|
| 7 |
+
pdf_directory = '/content/pdf_files'
|
| 8 |
+
|
| 9 |
+
# Directory for storing extracted text from PDFs
|
| 10 |
+
text_directory = '/content/extracted_text'
|
| 11 |
+
|
| 12 |
+
# OCR output directory for scanned PDFs
|
| 13 |
+
ocr_directory = '/content/ocr_output'
|
| 14 |
+
|
| 15 |
+
# Create directories if they don't exist
|
| 16 |
+
os.makedirs(pdf_directory, exist_ok=True)
|
| 17 |
+
os.makedirs(text_directory, exist_ok=True)
|
| 18 |
+
os.makedirs(ocr_directory, exist_ok=True)
|