Git Product home page Git Product logo

vector-databases-milvus's Introduction

Vector-Databases-Milvus

This repo contains notebooks of my experiments/learnings in Milvus.

I wrote about vector databases in my article here:

https://medium.com/towards-data-science/deep-dive-into-vector-databases-by-hand-e9ab71f54f80

and seeing Milvus in action while being able to draw correspondence to the theory was super!

Codes

I tried the intergration of BGE-M3 model with Milvus. For each sentence in the paper, we use BAAI/bge-m3 model to convert the text string into 1024 dimension vector embedding, and store each embedding in Milvus.The input text was the M3 paper itself.

Steps:

  1. Each sentence in the input file is first converted into a vector embedding of dimension 1024 and stored into Milvus.
  2. A 'collection' is created with the fields 'id', 'text' and 'embedding'.
  3. The next step is indexing where a shorter version of the embedding is produced for faster retrieval. Milvus does the heavy work with the parameters specified.
  4. Finally the query text is converted to vector embedding and compared with the vector embeddings obtained from the text.
  5. I try both cosine similarity metric and the L2 metric, both provide the same result. Note: Smaller the value, closer the vectors and hence a better match. Howeever, for cosine similarity the values are reversed - higher means better. Reason being cos(0°)=1, and thus a value closer to 1 will mean a smaller angular difference between the vectors and hence a closer match.

vector-databases-milvus's People

Contributors

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