Giter Club home page Giter Club logo

answerpdf's Introduction

AnswerPDF

AnswerPDF is a web app that allows users to upload PDF files, and then get answers to questions based on the contents of the PDFs. The app uses Gemini Pro, GenAI Embeddingds by Google and Facebook AI Similarity Search to accomplish this.

This project was made as a part of the GenAI Internship at IGDTUW held in association with Sansoftech in the Summer of 2024.

Features

  • Multiple PDFs support
  • PDF Text Extraction
  • Text Chunking
  • Vector Store Creation using FAISS and Google GenAI Embeddings
  • Question Prompt Generation using Gemini Pro
  • Interactive Streamlit interface for user input

Methodology

  • The PDF files uploaded by users are processed using the PyPDF2 library to extract text from each page of the document.
  • The extracted text is split into smaller chunks using a recursive character-based text splitter from LangChain. This helps in breaking down large texts into more manageable pieces for further processing.
  • Google Generative AI Embeddings are used to generate embeddings for each text chunk. These embeddings are then used to create a FAISS vector store, which enables efficient similarity search.
  • A conversational chain is set up using LangChain and the Gemini Pro model. This chain takes the user's question and context as input and generates a response based on the content of the uploaded PDF files.
  • The application provides an interactive web interface using StreamLit, where users can upload PDF files, input questions, and receive responses summarizing the content of the files.

Usage

  1. Clone the repository
  2. cd into the repository
cd AnswerPDF
  1. Install the necessary dependencies
pip install -r requirements.txt
  1. Create a Gemini API key from Google AI Studio
  2. Create a .env file and add your Google API Key:
GOOGLE_API_KEY="<your key here>"
  1. Run the application
streamlit run app.py
  1. Open the displayed link
  2. Upload PDF files and click Submit
  3. Start asking questions about their content!

answerpdf's People

Contributors

vaniasetia avatar

Watchers

Kostas Georgiou avatar  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.