Giter Club home page Giter Club logo

Comments (9)

generall avatar generall commented on August 18, 2024 1

fastembed=0.5.0

please try v0.1.1

from fastembed.

michaelfeil avatar michaelfeil commented on August 18, 2024 1

FYI for "BAAI/bge-base-en" i get a cosine_sim of ~0.999. For "sentence-transformers/all-MiniLM-L6-v2" its around 0.223

from fastembed.

NirantK avatar NirantK commented on August 18, 2024

Thanks for flagging this. Will investigate.

First guess would be that these are two different models possibly since FlagEmbedding is different from Sentence Transformers.

from fastembed.

michaelfeil avatar michaelfeil commented on August 18, 2024

On my system the code above still vails with v0.1.1 Have you tried the above code?

@NirantK For models, i use "sentence-transformers/all-MiniLM-L6-v2" on both sides.

from fastembed.

michaelfeil avatar michaelfeil commented on August 18, 2024

@NirantK

sentence-transformers=2.22
fastembed=0.1.1

sentence = ["This is a test sentence."]


arrays are not almost equal to 1 decimals

Mismatched elements: 2 / 384 (0.521%)
Max absolute difference: 0.81547204
Max relative difference: 2334.82220783
 x: array([ 1.4e-02, -1.9e-02,  6.3e-03,  3.0e-02,  1.8e-02, -1.5e-02,
       -8.6e-03,  1.3e-02,  1.1e-02, -4.0e-03, -6.7e-04,  7.2e-03,
        5.4e-03,  1.2e-02,  1.5e-03, -4.8e-03,  1.8e-02, -1.6e-02,...
 y: array([ 8.4e-02,  5.8e-02,  4.5e-03,  1.1e-01,  7.1e-03, -1.8e-02,
       -1.7e-02, -1.5e-02,  4.0e-02,  3.3e-02,  1.0e-01, -4.7e-02,
        6.9e-03,  4.1e-02,  1.9e-02, -4.1e-02,  2.4e-02, -5.7e-02,...

from fastembed.

nleroy917 avatar nleroy917 commented on August 18, 2024

Hey!

I've not done a thorough analysis, but I've also had some really quirky results with the fastembed embeddings as well. Some similarity scores don't make much sense at all, so I speculate if the embeddings are incorrect.

from fastembed.

NirantK avatar NirantK commented on August 18, 2024

Hey, I can confirm that the sentence-transforms quantization isn't perfect. The cosine similarity is lower than we'd like.
The retrieval performance doesn't see too much degradation in a small test that I ran, but yes — this is an important issue.

Thanks for flagging this.

from fastembed.

nleroy917 avatar nleroy917 commented on August 18, 2024

I am curious if this is still present? I want to use fastembed in my docker containers, but not sure if that's feasible with the mismatches

from fastembed.

I8dNLo avatar I8dNLo commented on August 18, 2024

So, this fix must resolve this issue

from fastembed.

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.