Skip to content
UsernameUditPublic

About

Uses tesseract OCR and Jev aswell to create word file out of images

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Wordex

image


Johannes Gutenberg Invented Printing Press back in around 1440s.

Origin

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.

Working and Usage

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/notes

Python 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.

Usage

Requirements

  • Python
  • Tesseract OCR
  • The Python packages listed in requirements.txt
  • A TypeSafe API key

Install the Python dependencies:

pip install -r requirements.txt

Demo

I maintain folders containing screenshots of C code snippets and sections from the book I'm studying.

Here is Wordex output to it.

Input

5 4

Output

wor4

wor3

wor2

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

About

Uses tesseract OCR and Jev aswell to create word file out of images

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages