Datasets:
Add 'sentence-transformers' tag for easier discoverability
Browse filesHello!
## Pull Request overview
* Add the `sentence-transformers` tag.
## Details
The upcoming Sentence Transformers v3 update will introduce training directly with `Dataset` instances, e.g. like so:
```python
from datasets import load_dataset
from sentence_transformers import SentenceTransformer, SentenceTransformerTrainer
from sentence_transformers.losses import MultipleNegativesRankingLoss
# 1. Load a model to finetune
model = SentenceTransformer("microsoft/mpnet-base")
# 2. Load a dataset to finetune on
dataset = load_dataset("nirantk/triplets", split="train").select_columns(["query", "pos", "neg"])
train_dataset = dataset[:-5000]
eval_dataset = dataset[-5000:]
# 3. Define a loss function (https://sbert.net/docs/training/loss_overview.html)
loss = MultipleNegativesRankingLoss(model)
# 4. Create a trainer & train
trainer = SentenceTransformerTrainer(
model=model,
train_dataset=train_dataset,
eval_dataset=eval_dataset,
loss=loss,
)
trainer.train()
# 5. Save the trained model
model.save_pretrained("models/mpnet-base-nirantk-triplets")
```
In preparation for the release, I'm going through and tagging some excellent datasets that immediately match one of the dataset formats required for one of the [loss functions](https://sbert.net/docs/training/loss_overview.html) as [`sentence-transformers`](https://huggingface.co/datasets?other=sentence-transformers). Then I can link to datasets with this tag in the Sentence Transformers documentation.
This dataset in particular matches the `(anchor, positive, negative) triplets` without any label, allowing this dataset to be used out of the box for CachedMultipleNegativesRankingLoss, MultipleNegativesRankingLoss, TripletLoss, CachedGISTEmbedLoss, and GISTEmbedLoss.
- Tom Aarsen
@@ -32,6 +32,8 @@ task_categories:
|
|
32 |
pretty_name: Nomic Triplets
|
33 |
size_categories:
|
34 |
- 1M<n<10M
|
|
|
|
|
35 |
---
|
36 |
|
37 |
Dataset built from [Nomic Contrastors](https://github.com/nomic-ai/contrastors) for training embedding models. Some (query, pos) pairs are repeated. All (query, pos, neg) triplets are unique.
|
|
|
32 |
pretty_name: Nomic Triplets
|
33 |
size_categories:
|
34 |
- 1M<n<10M
|
35 |
+
tags:
|
36 |
+
- sentence-transformers
|
37 |
---
|
38 |
|
39 |
Dataset built from [Nomic Contrastors](https://github.com/nomic-ai/contrastors) for training embedding models. Some (query, pos) pairs are repeated. All (query, pos, neg) triplets are unique.
|