You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: model2vec/train/README.md
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -106,3 +106,7 @@ The core functionality of the `StaticModelForClassification` is contained in a c
106
106
*`fit`: contains all the lightning-related fitting logic.
107
107
108
108
The training of the model is done in a `lighting.LightningModule`, which can be modified but is very basic.
109
+
110
+
# Results
111
+
112
+
We ran extensive benchmarks where we compared our model to several well known architectures. The results can be found in the [training results](https://github.com/MinishLab/model2vec/tree/main/results#training-results) documentation.
Copy file name to clipboardExpand all lines: results/README.md
+39-26Lines changed: 39 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -70,43 +70,56 @@ As can be seen, [potion-retrieval-32M](https://huggingface.co/minishlab/potion-r
70
70
71
71
The main results for Model2Vec training are outlined in this section.
72
72
73
-
We compare three different architectures:
73
+
We compare five different architectures for our main results:
74
74
-`model2vec + logreg`: A model2vec model with a scikit-learn `LogisticRegressionCV` on top.
75
75
-`model2vec full finetune`: A model2vec classifier with the full model finetuned. This uses our `StaticModelForClassification`.
76
+
-`tfidf`: A TF-IDF model with a scikit-learn `LogisticRegressionCV` on top.
76
77
-`setfit`: A [SetFit](https://github.com/huggingface/setfit/tree/main) model trained using [all-minilm-l6-v2](sentence-transformers/all-MiniLM-L6-v2) as a base model.
78
+
-`bge-base + logreg`: A [BGE-base](https://huggingface.co/BAAI/bge-base-en-v1.5) encoder model with a scikit-learn `LogisticRegressionCV` on top.
77
79
78
80
We use 14 classification datasets, using 1000 examples from the train set, and the full test set. No parameters were tuned on any validation set. All datasets were taken from the [Setfit organization on Hugging Face](https://huggingface.co/datasets/SetFit).
As can be seen see, full fine-tuning brings modest performance improvements in some cases, but very large ones in other cases, leading to a pretty large increase in average score. Our advice is to test both if you can use `potion-base-32m`, and to use full fine-tuning if you are starting from another base model.
103
109
104
-
The speed difference between model2vec and setfit is immense, with the full finetune being 35x faster than a setfit based on `all-minilm-l6-v2` on CPU.
110
+
The speed difference between model2vec and the other models is immeense, with the full finetune being 35x faster than a setfit based on `all-minilm-l6-v2` on CPU and 200x faster than the`bge-base` transformer model.
The figure below shows the relationship between the number of sentences per second and the average training score, where we've included more transformer-based models for comparison.
0 commit comments