Giter Site home page Giter Site logo

pdf_chatbot's Introduction

PDF_chatbot - a Multi-PDF Chat App

This is a Python application that allows you to chat with multiple PDF documents using natural language. It utilizes OpenAI's API and Facebook's Faiss library for semantic search to provide accurate responses based on the content of the loaded PDFs.

How it Works

The app follows these key steps:

  1. PDF Loading: The user can load multiple PDFs into the application.

  2. Text Extraction: The text content is extracted from the PDFs.

  3. Embedding Generation: Vector embeddings are generated for the extracted text chunks using OpenAI's text embedding API.

  4. Indexing: The text embeddings are indexed using Faiss for efficient similarity search.

  5. User Input: The user provides a natural language query via the chat interface.

  6. Embedding Lookup: The user query is converted to an embedding vector and compared against the indexed PDF embeddings.

  7. Response Generation: The most similar PDF text chunks are retrieved and used to generate a response with OpenAI's text generation API.

Installation

It's recommended to run this app in a Python 3.8 virtual environment.

Clone the repository to your local machine.

git clone https://github.com/corymullins/PDF_chatbot.git

Create and activate a virtual environment:

python3 -m venv pdfbot
source pdfbot/bin/activate

Install requirements:

pip install -r requirements.txt

Usage

  1. Obtain an API key for OpenAI, add it to .env

  2. Run streamlit run .\app.py

  3. Load PDFs using the upload button.

  4. Chat with the bot in natural language about the PDF contents.

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.