textract-demo-v2.mp4
This project aims to create a robust application that utilizes AWS Textract to extract information from structured and semi-structured PDF documents, and OpenAI's ChatGPT to interact with the application and analyze the results. These documents may contain both handwritten and printed text.
AWS Textract is a service that automatically extracts text and data from scanned documents. It goes beyond simple optical character recognition (OCR) to identify, understand, and extract data from forms and tables.
ChatGPT is a language model developed by OpenAI. In this application, we use it to interact with users and analyze the results of AWS Textract.
To use this application, follow the steps below:
You will need an AWS account, OpenAI account, the AWS CLI (Command Line Interface) installed on your local machine, and setup your OpenAI and AWS credentials to authenticate with their services. Here is a guide to set up AWS. For OpenAI setup, please refer to the OpenAI API documentation.
-
Install Anaconda on your machine. Visit the Anaconda website for installation instructions.
-
Create a new conda environment and install the required dependencies by running the following commands:
$ conda env create -f environment.yml
$ conda activate aws-text
-
Make sure you have activated the
aws-text
conda environment. -
Run the
application.py
file to start the application. This file sets up a local server that accepts PDF uploads, runs AWS Textract on the uploaded PDFs, then uses ChatGPT to interact with the application and analyze the results.
$ python application.py
-
Access the application by opening your web browser and navigating to
http://localhost:5000
. -
Upload your PDF files through the web interface. The results of AWS Textract will be displayed on the page, and you can also interact with ChatGPT to analyze the results. You can download the results in JSON, PDF (with bounding boxes), and CSV formats.
The outputs are located in app/results/textract_results
, app/results/bounding_box_results
, and app/results/table_results
.
- AWS Textract - Text extraction service
- ChatGPT - A interactive LLM
- Flask - Web framework
- Brady Mitchelmore - Initial work - bradymitchelmore