Convert PDF files to Markdown using WiseDiag MedOcr API. Supports table recognition, multi-column layouts, and medical document OCR. Usage: Upload a PDF file and say Use MedOcr to process this.
Convert PDF files into Markdown format. The script handles API authentication, file upload, OCR processing, and saves the result automatically.
You MUST use the provided script to process files. Do NOT call any API or HTTP endpoint directly.
The script scripts/medocr.py handles everything:
WISEDIAG_API_KEY from environment)WiseDiag-MedOcr-1.0.0/{filename}.mdGet your API key: 👉 https://chat.wisediag.com/apiKeyManage
export WISEDIAG_API_KEY=your_api_key
pip install -r requirements.txt
To process a PDF file, run:
cd scripts
python medocr.py -i /path/to/input.pdf
The script will automatically save the result to WiseDiag-MedOcr-1.0.0/{filename}.md.
Example:
python medocr.py -i /path/to/体检报告.pdf
# Output saved to: WiseDiag-MedOcr-1.0.0/体检报告.md
With custom output directory:
python medocr.py -i /path/to/input.pdf -o /custom/output/dir
| Flag | Description |
|---|---|
-i, --input | Input PDF file path (required) |
-o, --output | Output directory (default: ./WiseDiag-MedOcr-1.0.0) |
--dpi | PDF rendering DPI, 72-600 (default: 200) |
After the script runs, the Markdown file is saved automatically:
WiseDiag-MedOcr-1.0.0/{filename}.md报告.pdf → 报告.md)MIT