Ibrahim5020/lisanify-docling
0
Lisanify Docling API
Document conversion API with OCR support for the Lisanify translation app.
Endpoints
GET /health
Health check endpoint.
POST /convert
Convert documents (PDF, DOCX, PPTX) to structured text blocks.
Parameters:
file: Document file (multipart/form-data)ocr: OCR mode -off,auto, oralways(default:auto)lang: Tesseract language code for OCR (default:eng)source_lang: Source language of document (default:eng)segment: Sentence segmentation -offorsentences(default:off)segment_lang: Language for segmentation (optional)
Supported Languages for OCR:
- English (eng), German (deu), Turkish (tur), French (fra)
- Spanish (spa), Italian (ita), Portuguese (por), Dutch (nld)
- Polish (pol), Russian (rus), Arabic (ara)
- Japanese (jpn), Korean (kor), Chinese Simplified (chisim), Chinese Traditional (chitra)
Example Usage
import requests
url = "https://ibrahim5020-lisanify-docling.hf.space/convert"
files = {"file": open("document.pdf", "rb")}
data = {"ocr": "always", "lang": "deu", "source_lang": "deu"}
response = requests.post(url, files=files, data=data)
result = response.json()
print(f"Extracted {len(result['blocks'])} text blocks")