Git Product home page Git Product logo

subhangisati / langchat-explorer Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 482 KB

"LangChat Explorer: Your intuitive document companion. Effortlessly explore vast information with natural language conversations. Simplify queries, gain insights, and embark on a seamless journey of knowledge discovery. Unleash the power of language with LangChat Explorer."

Python 43.13% Batchfile 10.66% Shell 21.74% Nushell 11.90% PowerShell 12.56%

langchat-explorer's Introduction

LangChain Explorer

Overview

This Streamlit web application, LangChain Explorer, leverages LangChain's powerful capabilities for question answering and information retrieval. It enables users to input queries and receive relevant answers from a collection of PDF documents. The application employs various language models and embedding techniques to provide accurate and context-aware responses.

Prerequisites

  • Python 3.x
  • Streamlit
  • langchain library
  • Hugging Face Transformers
  • PyTorch (if using GPU)

Installation

Ensure you have the required dependencies installed using:

pip install streamlit langchain torch

Additionally, you may need to install the Hugging Face Transformers library:

pip install transformers

Usage

  1. Download the PDF documents and place them in a directory (replace 'data/' with the actual directory path).
  2. Run the Streamlit app using the following command:
streamlit run langchain_explorer.py
  1. Enter your query in the input box and click the "Submit" button to receive relevant answers.

Code Structure

  • Document Loading and Splitting:

    • PDF documents are loaded from a specified directory using LangChain's PyPDFLoader and split into text chunks.
  • Embedding and Vector Store:

    • LangChain utilizes Hugging Face embeddings to convert text chunks into embeddings.
    • A FAISS Vector Store is created from the embeddings.
  • Question Answering Chain:

    • LangChain's RetrievalQA is configured to retrieve relevant information from the vector store.
    • A language model (LLM) is used to generate answers based on the retrieved information.
  • Streamlit App:

    • A Streamlit web application allows users to input queries and receive real-time answers.

Steps to Run

  1. Configure the data path, model paths, and other parameters according to your setup.

  2. Run the Streamlit app script:

streamlit run langchain_explorer.py
  1. Open the provided local URL in your web browser.

Customization

  • Adjust the data path, model paths, and other configurations based on your document collection and language model choices.

License

This code is licensed under the MIT License.

Feel free to customize and use this code for your question answering and information retrieval tasks. If you find it helpful, consider providing attribution to the original source.

langchat-explorer's People

Contributors

subhangisati avatar

Stargazers

Abhishek Joshi 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.