CoolFace
Apppublic

Ibrahim5020/lisanify-docling

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
0likes
App README

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, or always (default: auto)
  • lang: Tesseract language code for OCR (default: eng)
  • source_lang: Source language of document (default: eng)
  • segment: Sentence segmentation - off or sentences (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

python
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")