Chatbot-PDF

This repository is created for the web development project of Custom PDF ChatBot by METIS, IITGN.

APACHE-2.0 License

Stars
2
Committers
3

PDF - ChatBot

Table of Contents

Introduction

This repository contains a Flask-based web application that allows users to upload PDF files and interact with the chatbot to get responses to their queries on the content of the uploaded PDF. This project was developed for the summer projects released by Metis Club, IIT Gandhinagar. The LLM used was Llama3 by Meta, and the tech stack in frontend included HTML, CSS, Javascript, and FetchAPI integration; in backend, Python and Flask were used.

Features

  • Efficient reading of pdf files using Llamaparse
  • Interactive UI that simulates chatting

Screenshots

Installation

Clone the repository

git clone https://github.com/HarshilShah1804/Chatbot-PDF.git
cd Chatbot-PDF

Install Dependencies

pip install -r requirements.txt

Setting up Environment Variables

In Chatbot.py, add your Gradient access token and workspace ID and your llamaindex API key

os.environ['GRADIENT_ACCESS_TOKEN'] = "YOUR_GRADIENT_ACCESS_TOKEN"
os.environ['GRADIENT_WORKSPACE_ID'] = "YOUR_GRADIENT_WORKSPACE_ID"
api_key="your_api_key"

Run the application

python app.py

By default, the application will be accessible at http://127.0.0.1:5000/.

Usage

The app is configured in a way that it will not give answers to questions outside the scope of the PDF.

Uploading a PDF.

  1. Click on the "Upload" button.
  2. Select the PDF file from your system. It will be automatically uploaded.

Asking a query

  1. After uploading a PDF, the bot will take some time to parse it, and a prompt will appear once it is ready to answer your queries.
  2. After getting the prompt, type your query in the text box and click the send button.

License

Distributed under the Apache License 2.0. See LICENSE for more information.

Contributing

Contributions make the open-source community such an amazing place to be, learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contributors

Harshil Shah | Rishank Soni | Samarth Sonawane

Badges
Extracted from project README's
GitHub issues GitHub stars GitHub license
Related Projects