Johannes Gutenberg Invented Printing Press back in around 1440s.
The original main.py was written by me back in August.
I was making an imaginary scenario in my mind what if you had a lot of images with text you want to make a word document out of them?
At the time, I thought about two approaches:
- Send the images to an LLM/VLM.
- Process them locally.
My potato PC can't handle VLMs, so I went with the OCR approach
I also happened to meet someone who had a tedious typing job, which made me think that this could actually be useful.
So I wrote a small Python script using Tesseract OCR and
python-docx to turn images into Word documents.
A few days ago, Jev came out. I played around with it and started thinking about this project again.
That led to wordex_v1.py
Jev isn't doing anything grand here. I'm mainly experimenting with what happens when a decision model is placed between OCR and document generation. I'll explain it below.
The working is pretty simple. You pass a filepath to an image or a folder to wordex as:
python wordex_v1.py C:/User/admin/Desktop/notesPython calls Tesseract OCR and parses its TSV output to create blocks that can be passed to Jev to decide the semantics (is it a paragraph/heading/metadata etc.). Then, Python executes as per Jev confidence on a block of image.
- Python
- Tesseract OCR
- The Python packages listed in
requirements.txt - A TypeSafe API key
Install the Python dependencies:
pip install -r requirements.txtI maintain folders containing screenshots of C code snippets and sections from the book I'm studying.
Here is Wordex output to it.
There do are many mistakes, many missing character it is because of the OCR but the thing is it works. we can change the OCR model in the future
The document structure have been handled pretty well by Wordex. It was able to distinguish between heading,paragraphs,list and other blocks and make a pretty neat word document
