Giter Club home page Giter Club logo

q_-_a_with_multiple_pdfs's Introduction

Q_&_A_with_Multiple_PDFs

Q & A with multiple pdf App is a Python application that allows users to upload multiple PDF documents, ask questions about them and use natural language model to generate accurate answers based on the content of those documents.

  1. Imports:
  • It starts by importing various libraries, including Streamlit (streamlit), dotenv (load_dotenv), PyPDF2 (PdfReader), and several components from the Langchain library. It also imports HTML templates and specific modules like css, bot_template, and user_template.
  1. PDF Text Extraction:

    • The get_pdf_text function extracts text from the uploaded PDF documents using the PyPDF2 library.
  2. Text Chunking:

    • The get_text_chunks function splits the extracted text into smaller chunks, presumably for efficient processing. It uses the Langchain library's
      CharacterTextSplitter for this purpose.
  3. Vector Store Creation:

    • The get_vectorstore function creates a vector store from the text chunks using Langchain's OpenAIEmbeddings and FAISS vector store. This could be used for semantic search and retrieval.
  4. Conversational Chain Setup:

    • The get_conversation_chain function sets up a conversational chain using Langchain's ChatOpenAI or HuggingFaceHub models. This chain appears to handle user questions and generate responses based on the document content.
  5. User Interaction:

    • The handle_userinput function takes a user's question as input, uses the conversation chain to generate responses, and displays the conversation history between the user and the chatbot in the Streamlit interface.
  6. Streamlit Setup:

    • The main function sets up the Streamlit application. It configures the page title, icon, and adds a header.
  7. User Interface:

    • Users can input questions related to the uploaded PDF documents.
    • They can upload multiple PDFs using the file uploader in the sidebar.
    • When the "Process" button is clicked, the code processes the PDFs, extracts text, creates a vector store, and sets up the conversation chain.
  8. Running the App:

    • The app is launched when the script is run as the main module (if __name__ == '__main__': main()).

q_-_a_with_multiple_pdfs's People

Contributors

sahilichake 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.