Code Monkey home page Code Monkey logo

Comments (5)

Raidus avatar Raidus commented on June 11, 2024 7

I have reduced the dimensions with UMAP and visualized the embeddings of the training set with all-MiniLM-L12-v2 vs all-MiniLM-L12-v2-setfit (fitted model). Then I just highlighted every text which includes "acne" and "pimple". The green ones are which do not include "acne" or "pimple". The actual task was a binary classification if a text is related to skincare or not.

It looks like that the model "learned" that "acne" and "pimple" are very close. Their embeddings are closer on average after fitting the model with the training data. I did not calculate the average distance of those embeddings but from a visual point they should be closer together.

That tells me that even after binary classification the embeddings could be used improving the semantic search. I'll do another test with a multi-label classification but creating the training set needs some data wrangling. When I've found some time to do test, I'll post the results here.

setfit_vs_raw

from setfit.

hanshupe avatar hanshupe commented on June 11, 2024

I am very interested in this topic too - planning to use only the fine-tuning part and use the embeddings for semantic search. Any thoughts?

from setfit.

pleonova avatar pleonova commented on June 11, 2024

This is super neat! Thanks for sharing the UMAP comparison @Raidus!

Tangential question, are you uploading your model to the HF hub or you storing the fine-tuned model locally and then calling it to get the embeddings?

from setfit.

tomaarsen avatar tomaarsen commented on June 11, 2024

Very interesting experimental results. Out of curiosity, the model_sbert/all-MiniLM-L12-v2 SentenceTransformer is not finetuned on the data, right?

from setfit.

karndeepsingh avatar karndeepsingh commented on June 11, 2024

Hi,
How I can train the model Setfit model for semantic search assuming I don't have labeled data ( let's say I have product descriptions) then how I can use the trainer Setfit trainer to create positive and negative samples, as per the hugging face blog it needs a few labels to train right? (Correct me if I am wrong)
Please, help to understand the process of how I can just use the product description to train setfit model and use that on my queries for semantic search

Thanks

from setfit.

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.