GithubHelp home page GithubHelp logo

tushar2407 / chat_with_pdf Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3.29 MB

This particular mini-project is the base setup for custom chatgpt talk with any pdf of your choice.

Jupyter Notebook 99.54% Python 0.46%

chat_with_pdf's Introduction

Talk to PDF

This mini-project involves a combination of OpenAI, LangChain and Facebook AI Similarity Search (FAISS) to be able to talk to any PDF of your choice.

OpenAI is mainly used for its embeddings model.

LangChain is the main library which helps in ease of question-answering the "PDF" as it is a wrapper which enables us to embed the PDF, store in a vector database, connects to FAISS to help with similarity search whenever a new query is sent to our custom chatbot.

In order to use the code in script.ipynb, you will need to make a .env file with OPEN_API_KEY key having the value of API key from your account on OpenAI.

Quickstart

Make sure to clone the repo on your machine before starting:

git clone https://github.com/tushar2407/talk_to_pdf.git
cd talk_to_pdf

Let's dive into the tutorial on talking to PDF of your choice. First, create a virtual environment using the below command:

virtualenv venv

Next, activate your venv virtual environment:

# for Linux/Mac
source venv/bin/activate

# for Windows
venv\Scripts\activate 

Now, install all the required packages:

pip install -r requirements.txt

Lastly, create a .env file with the following format:

OPENAI_API_KEY="..."

In the file, replace "..." with your OpenAI's API key.

With the above steps, you are all set to run script.ipynb without any error.

๐Ÿšจ Caution: Make sure to select your Jupyter Notebook's kernel as your current virtual environment.

New Sources:

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.