Giter VIP home page Giter VIP logo

pdf-reader-using-langchain-and-streamlit's Introduction

PDF-Reader-using-LangChain-and-Streamlit

Overview

This Streamlit application, powered by LangChain, serves as an interactive reader for PDF documents. It employs natural language processing (NLP) and chat models to enable users to ask questions about the contents of uploaded PDFs and receive informative responses.

Installation

Ensure you have Python installed on your system. Use the following commands to set up and run the application:

pip install -r requirements.txt
streamlit run app.py

How to Use

    Access the application through the provided Streamlit URL.
    Upload a PDF document.
    Click the "Process" button to analyze the document.
    Ask questions related to the document's content.
    The application provides interactive chat responses and displays relevant pages of the document.

Dependencies

    Streamlit
    LangChain
    PyPDF2
    Tempfile
    Base64

File Descriptions

    app.py: The main application script.
    htmlTemplates.py: Contains HTML templates used for rendering chat messages.

Tasks
Task 1: Import the Libraries

The necessary libraries are imported, including Streamlit, LangChain, and other dependencies.
Task 4: Process the Input PDF

Defines a function process_file to process the uploaded PDF using LangChain embeddings and retrieval models.
Task 6: Method for Handling User Input

The handle_userinput function manages user queries, updates the chat history, and displays messages in an interactive chat format.
Main Function

The main function sets up the Streamlit layout, processes user input, and displays the results interactively.

pdf-reader-using-langchain-and-streamlit's People

Contributors

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