Git Product home page Git Product logo

unifyai_rag_playground's Introduction

Introduction

RAG playground -

Build a RAG application which will let you upload PDF's and ask questions about them.

LLamaIndex was used to create RAG. Streamlit for interface.

Basic RAG concepts were used to develop this project:

  1. Load PDF and then read text using PDFReader.
  2. Loading of data into Documents in LLamaIndex and chunking and converting them into nodes all this was done using VectorStoreIndex.from_documents
  3. The text is then chunked and converted to embeddings - for embeddings BGE model was used specifically - BAAI/bge-small-en-v1.5
  4. After retreival added reranker which will reorder search results based on their relevance to a query. So after query retreival reorder happens. In this case first we will get 10 chunks based on similarity they are reranked using reranker which will give top 3.

The application was built using Streamlit and to optimize streamlit @st.experimental_fragment and @st.cache_resource were used.

Quick Demo

streamlit-app-2024-05-09-02-05-91.webm

Deployment

Streamlit App - https://unifyai-rag-playground.streamlit.app/

Instructions to run locally:

  1. First create a virtual environment in python
python -m venv <virtual env name>
  1. Activate it and install poetry
source <virtual env name>/Scripts/activate - Windows
source <virtual env name>/bin/activate - Linux/Unix
pip install poetry
  1. Clone the repo
git clone https://github.com/abhi2596/UnifyAI_RAG_playground/tree/main
  1. Run the following commands
poetry install 
cd rag
streamlit run app.py

unifyai_rag_playground's People

Contributors

abhi2596 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

mdwoicke

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.