Code Monkey home page Code Monkey logo

weaviate-tutorial's Introduction

weaviate-tutorial

Installation

git clone https://github.com/ulricharmel/weaviate-tutorial.git
cd weaviate-tutorial
pip install -r requirements.txt

Workflow

The workflow code in workflow.py implements a basic RAG, that gets it context from an input pdf file. It uses ollama and llama3 to compute embeddings and anwser questions. Before running the script, create an environment file (.env) using the template .env-examples. Make sure to download ollama and pull the model version you specify in your environment file.

The most expensive part of the code is the step that computes and adds the vector embeddings to the weaviate database. Hence use --pages flag to use only a few pgaes from your document. The chunking approach I use is to merge every 4 sentences together as one entry for the database.

python workflow.py [input_pdf_file] --pages [number_of_pages]

Limitations

This workflow is very limited, for a proper RAG implementation, we will need a better parser such as maybe the llama-parser which has more efficient chunking strategies. Also we can incomporate a grade to rate if the retriever context is relevant to the question, if this is not the case we instead do a web search. Finally, we can also incomparate something to prevent hallucinations and output no answer if the model can confidently answer the question.

For the second track

Look at the job_listings_clustering notebook.

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.