Coder Social home page Coder Social logo

Comments (4)

okhat avatar okhat commented on July 3, 2024

Hey @deepankar27 !

In our faiss representations, we store a flat matrix indeed. So we'll store 15 embeddings. If you had two documents, one with 15 tokens and the other with 20 tokens, we'll feed faiss a matrix with shape (15+20, 128).

Hope this helps! Let me know if you have any other questions.

from colbert.

deepankar27 avatar deepankar27 commented on July 3, 2024

Hello, @okhat thanks a lot for the response. I understood your explanation. I believe that's why we are wrote this code in :

Q_faiss = Q.view(num_queries * embeddings_per_query, dim).cpu().contiguous()

This lead to only few last questions:

  1. If my understanding is correct then are we storing these embeddings against emb2pid?
    self.emb2pid[offset_doclens: offset_doclens + dlength] = pid_offset + pid
    self.emb2pid[offset_doclens: offset_doclens + dlength] = pid_offset + pid
  2. Are we performing two level of quantization for Query embeddings as well?
  3. How about storing the non stopwords tokens only, that way we would be storing only the tokens which are representing the context and size/ shape could be smaller.

from colbert.

okhat avatar okhat commented on July 3, 2024

Dropping stopwords is fine in practice, indeed!

emb2pid is just a mapping from each embedding to its document of origin.

Queries are not compressed with FAISS.

from colbert.

deepankar27 avatar deepankar27 commented on July 3, 2024

@okhat Thanks and appreciate your responses 👏

from colbert.

Related Issues (20)

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.