Catagorize this question
cd /home/daytona/workspace/attachments/4dbfd4ba-37f1-4373-927d-a9888f893656 && python3 -c " import pdfplumber with pdfplumber.open('board-1 patho.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): text = page.extract_text() print(f'--- PAGE {i+1} ---') print(text) print() "
python3 -c " import subprocess result = subprocess.run(['ocrmypdf', '--version'], capture_output=True, text=True) print(result.stdout, result.stderr) result2 = subprocess.run(['tesseract', '--version'], capture_output=True, text=True) print(result2.stdout, result2.stderr) "
python3 -c " from pdf2image import convert_from_path pages = convert_from_path('/home/daytona/workspace/attachments/4dbfd4ba-37f1-4373-927d-a9888f893656/board-1 patho.pdf', dpi=200) print(f'Converted {len(pages)} pages') # Save first few pages as images import os os.makedirs('/home/daytona/workspace/patho_pages', exist_ok=True) for i, page in enumerate(pages): page.save(f'/home/daytona/workspace/patho_pages/page_{i+1}.png') print('Saved all pages') "
python3 -c " import pytesseract from PIL import Image import os pages_dir = '/home/daytona/workspace/patho_pages' all_text = '' for i in range(1, 13): img_path = f'{pages_dir}/page_{i}.png' img = Image.open(img_path) text = pytesseract.image_to_string(img) all_text += f'\n=== PAGE {i} ===\n' + text + '\n' with open('/home/daytona/workspace/patho_ocr.txt', 'w') as f: f.write(all_text) print('OCR complete') print(all_text[:3000]) "
python3 -c " import pytesseract from PIL import Image img = Image.open('/home/daytona/workspace/patho_pages/page_1.png') text = pytesseract.image_to_string(img) print(text[:2000]) " 2>&1 & sleep 30 && kill %1 2>/dev/null; echo "done"
python3 << 'EOF' import pytesseract from PIL import Image pages_dir = '/home/daytona/workspace/patho_pages' all_text = '' for i in range(2, 13): try: img = Image.open(f'{pages_dir}/page_{i}.png') # Reduce image size for faster OCR img = img.resize((img.width//2, img.height//2)) text = pytesseract.image_to_string(img, timeout=20) all_text += f'\n=== PAGE {i} ===\n' + text + '\n' print(f'Page {i} done') except Exception as e: print(f'Page {i} error: {e}') with open('/home/daytona/workspace/patho_ocr_rest.txt', 'w') as f: f.write(all_text) print('DONE') EOF
| # | Category | Approx. No. of Questions |
|---|---|---|
| 1 | Genetic Disorders | 11 |
| 2 | Blood Grouping & Transfusion | 6 |
| 3 | Neoplasia | 21 |
| 4 | Leukaemia | 7 |
| 5 | Haemodynamic Disorders | 11 |
| 6 | Haemorrhagic Disorders | 7 |
| 7 | Inflammation | 10 |
| 8 | Anaemia | 8 |
| 9 | Cell Injury | 7 |
| 10 | Haemoglobin & General Haematology | 6 |
| Total | ~94 questions |