Git Product home page Git Product logo

gpt-pdf-summarizer's Introduction

PDF Summarizer with GPT and Streamlit

About

This project is a PDF summarizer that leverages GPT AI to generate summaries from uploaded PDF files. The application uses FastAPI for the backend and Streamlit for the frontend. The project was created with the assistance of AI language models.

Getting Started

These instructions will help you set up and run the project on your local machine for development and testing purposes.

Prerequisites

  • Docker
  • Docker Compose

Installation

  1. Clone the repository:
git clone https://github.com/zerebom/gpt-pdf-summarizer.git
cd gpt-pdf-summarizer
  1. Add your API Key in the docker-compose.yml file
environment:
      - OPENAI_API_KEY=${OPENAI_API_KEY}
  1. Build and run the Docker container using Docker Compose:

This command will build the Docker image, start the container, and run both FastAPI and Streamlit applications.

docker-compose up --build
  1. Access the applications:
  • FastAPI: Open your browser and navigate to http://localhost:8001. You will see the FastAPI documentation (Swagger UI).
  • Streamlit: Open your browser and navigate to http://localhost:8501. You will see the Streamlit user interface where you can upload PDF files and get summaries.

Usage

  1. In the Streamlit app, upload a PDF file using the file uploader.

  2. Once the file is uploaded, the application will extract the text from the PDF and send it to the GPT API for summarization.

  3. The summarized text will be displayed on the Streamlit app. You can also interact with the GPT AI to ask questions about the summarized content.

Project Structure

The project is organized as follows:

project_name/
├── app/
│ ├── api/
│ │ ├── init.py
│ │ ├── dependencies.py
│ │ ├── main.py
│ │ └── pdf_summary.py
│ ├── core/
│ │ ├── init.py
│ │ ├── config.py
│ │ └── settings.py
│ ├── db/
│ │ ├── init.py
│ │ ├── database.py
│ │ └── models.py
│ ├── services/
│ │ ├── init.py
│ │ ├── pdf_extraction.py
│ │ └── openai_api.py
│ ├── main.py
│ └── tests/
│ ├── init.py
│ ├── conftest.py
│ └── test_pdf_summary.py
├── .gitignore
├── Dockerfile
├── docker-compose.yml
├── pyproject.toml
└── README.md

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to the project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

gpt-pdf-summarizer's People

Contributors

aatitkarki avatar fcpercival avatar zerebom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gpt-pdf-summarizer's Issues

Failed to start docker container

I am having trouble starting a Docker container using docker-compose. When I run the command docker-compose up --build, the build process finishes successfully, but the container fails to start.

: not foundmarizer-pdf-summariser-1  | start_services.sh: 1:
: not foundmarizer-pdf-summariser-1  | start_services.sh: 3:
: not foundmarizer-pdf-summariser-1  | start_services.sh: 5:
: not foundmarizer-pdf-summariser-1  | start_services.sh: 7:
: not foundmarizer-pdf-summariser-1  | start_services.sh: 8:
: not foundmarizer-pdf-summariser-1  | start_services.sh: 9:
: not foundmarizer-pdf-summariser-1  | start_services.sh: 11: wait
gpt-pdf-summarizer-pdf-summariser-1 exited with code 127

I am using a Dockerfile and a docker-compose.yml file, both of which are located in the root directory of my project. I am running Docker version 20.10.9 on Windows 10.

Can you please help me solve this issue? Any suggestions or advice would be greatly appreciated.

Thank you.

For some reason, error500 appears.

imge1
image2

An ERROR will appear as shown in the image.
I persisted in my own way for 2 days, but it does not work.

We have created a new OpenAI API and have confirmed that it works with other API services and applications.

ChatGPT4 advised me that I need to change pdf_summary.py and summary_service.py.

The build environment is as follows
Windows10Pro
VSCode
dockerCompass

CRLF is changing line breaks to LF.

Thank you for your advice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.