Comments (5)
Hi @castafra, Thanks for your question. Currently Setfit does not support two sentences similarity classification tasks and it's not trivial to apply SetFit for that. It will probably require changes within the Sentence Transformer itself. We do have plans to extend SetFit and one of the options is to examine similarity classification task. Having said that, i did play a bit with it, as a workaround, I simply concatenated sentence1 and sentence2 and input pairs of 2 concatenated sentences to the contrastive training process. The results weren't so good. SetFit was on-par with the baseline model (a 'standard' BERT cross encoder) when using few-shot data (8,16,32 samples). The bottom line is that this workaround is not recommended.
from setfit.
I also work on the similarity classification task. I think it would be great to extend the framework for that task.
It seems setFit
uses the underlying sentence_transformer
library, right? FWIW, the example shows how to use sentence_transformer
for similarity learning - https://www.sbert.net/examples/training/sts/README.html . I'm wondering whether we just need to implement a sklearn-learn
classifier model to take two fine-tuned embeddings as inputs to predict the label.
Other references:
- https://keras.io/examples/vision/metric_learning_tf_similarity/
- https://keras.io/examples/vision/siamese_network/
from setfit.
Hi @castafra thanks for your interest in our work! I know @orenpereg ran some experiments on 2-sentence tasks like GLUE, but it wasn't entirely clear how one should create the text/label triples one needs for the contrastive learning step.
Perhaps he can share some more details on what worked / didn't work :)
from setfit.
Hi @orenpereg , could you share any feedbacks on your experiments ?
Thanks
from setfit.
Hi @castafra, Thanks for your question. Currently Setfit does not support two sentences similarity classification tasks and it's not trivial to apply SetFit for that. It will probably require changes within the Sentence Transformer itself. We do have plans to extend SetFit and one of the options is to examine similarity classification task. Having said that, i did play a bit with it, as a workaround, I simply concatenated sentence1 and sentence2 and input pairs of 2 concatenated sentences to the contrastive training process. The results weren't so good. SetFit was on-par with the baseline model (a 'standard' BERT cross encoder) when using few-shot data (8,16,32 samples). The bottom line is that this workaround is not recommended.
This is a bummer :( I was so excited that I could few shot improve postal address comparisons... :D
from setfit.
Related Issues (20)
- Can we use Setfit just for finetuning ST Embedding model to create embeddings HOT 2
- MultiGPU support or better intergration for loading models
- i found a typo in docs HOT 1
- Methodological error in zero cost, zero time, zero shot notebook HOT 2
- Usage of deprecated `evaluation_strategy` in TrainingArguments HOT 1
- Data validation when using differentiable_head
- Can you please add an example with early stopping based on classification loss?
- how to optimize setfit inference
- exception:enum PyPreTokenizerTypeWrapper, while loading the fine-tuned model for evaluation HOT 7
- Regarding expanding the label column
- Setfit can't doing model prediction after training for MultiClass Classification with hf Trainer HOT 1
- Item taxonomy generation
- The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
- Possibility to monitor head training?
- Model checkpoints saved during the training are unusable
- Example from quick start fails with 'TrainingArguments' object has no attribute 'eval_strategy' HOT 5
- Clarification on end_to_end vs trainer.train_embeddings HOT 1
- Savely save & load SetFitModel with custom differentiable head
- Multiclass Training Error HOT 1
- setfit example does not work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from setfit.