Coder Social home page Coder Social logo

chat-wit-pdf's Introduction

Chat with PDF

Chat with PDF is a Streamlit application that allows users to upload PDF files, process the text within them, and ask questions about the content. The app uses LangChain, Google Generative AI, and FAISS for embedding, vectorizing, and answering questions based on the uploaded PDFs.

Features

  • Upload multiple PDF files
  • Extract text from PDF files
  • Split text into manageable chunks
  • Generate embeddings using Google Generative AI
  • Vectorize text chunks using FAISS
  • Answer user questions based on the content of the PDFs

Requirements

  • Python 3.8 or later
  • Streamlit
  • PyPDF2
  • LangChain
  • FAISS
  • LangChain Google Generative AI
  • Google Generative AI SDK
  • python-dotenv

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/chat-with-pdf.git
    cd chat-with-pdf
  2. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install the required packages:

    pip install -r requirements.txt
  4. Create a .env file in the root directory and add your Google API key:

    GOOGLE_API_KEY=your_google_api_key
    

Usage

  1. Run the Streamlit application:

    streamlit run app.py
  2. Open your browser and go to http://localhost:8501.

  3. Upload your PDF files using the sidebar and click "Submit & Process".

  4. Ask a question in the input field and get answers based on the content of the uploaded PDFs.

License

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

Acknowledgements

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any bugs, features, or documentation improvements.

Contact

For any questions or suggestions, please open an issue on the GitHub repository or contact the author.

chat-wit-pdf's People

Contributors

abhijit-tk avatar

Watchers

 avatar

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.