Skip to content

extract text from irregular forms in an image using google vision

License

Notifications You must be signed in to change notification settings

hududed/image2text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Extract texts from images using tokens

This program aims to structure the extract texts from images that are typically jumbled when using Google OCR. In particular, we deal with texts from irregular table forms and store these electronically in a dataframe.

Motivation

Although Google OCR output is often unstructured, we do get access to information about the entities and their positions in a JSON output file. However, the unstructured JSON data makes it difficult to extract tokens, i.e. characters without spaces in between. The objective is to postprocess the data so that extracting whole lines of text or phrases is possible. Once the tokens are extracted, we store them in a dataframe and clean the data according to our specifications. Note, the data clean-up here is strictly case-by-case and works relatively well for our problem.

Requirements

This program uses google-cloud-vision. Try pip install google-cloud-vision.
See requirements. Advisable to create a new virtual environment and run pip install -r requirements.txt.
This program assumes you have google credentials for google vision API setup (!).

Example Usage

Find the notebook here

About

extract text from irregular forms in an image using google vision

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published