Skip to content

This is a Flask backend that allows users to upload a PDF file and receive a simplified and humorous explanation of its contents using OpenAI's GPT-3 API. The application uses NLTK to split the PDF text into smaller chunks to stay within the API's maximum token limit, and PyPDF2 to extract the text from the PDF file.

Notifications You must be signed in to change notification settings

sumitra19jha/PDF-Converter-Backend-GPT3.5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Converter Flask Backend with OpenAI GPT-3.5 Integration

This is a web application built with Python and Flask that allows users to upload a PDF file and receive a simplified, humorous explanation of the contents using OpenAI's GPT-3 API. The application uses NLTK to split the PDF text into smaller chunks to stay within the API's maximum token limit, and PyPDF2 to extract the text from the PDF file.

Prerequisites

To run this application, you will need:

  • Python 3.6 or later
  • An OpenAI API key

Installation

  1. Clone this repository to your local machine.
  2. Install the required packages using pip:
pip install -r requirements.txt
  1. Set your OpenAI API key as an environment variable:
export OPENAI_API_KEY=your-api-key-here

Frontend

You can find the frontend code for this project at the following link: https://github.com/sumitra19jha/PDF-Converter-React-Frontend

Make sure to follow the instructions in the frontend README.md file to set up and run the application.

Usage

  1. Start the Flask server:
python app.py
  1. Navigate to frontend(http://localhost:3000) in your web browser.
  2. Upload a PDF file, and provide a city and country to use in the explanation.
  3. Click "Submit" and wait for the GPT-3 API to generate a response.
  4. The response will be displayed on the right-hand side of the page, along with page numbers for multi-page PDFs.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

This is a Flask backend that allows users to upload a PDF file and receive a simplified and humorous explanation of its contents using OpenAI's GPT-3 API. The application uses NLTK to split the PDF text into smaller chunks to stay within the API's maximum token limit, and PyPDF2 to extract the text from the PDF file.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages