tomaarsen HF staff commited on
Commit
ce4f078
1 Parent(s): 8fc8368

Add 'sentence-transformers' tag for easier discoverability

Browse files

Hello!

## 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("WhereIsAI/github-issue-similarity", "positive")
train_dataset = dataset["train"]
eval_dataset = dataset["dev"]

# 3. Define a loss function
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("models/mpnet-base-GIS")
```

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) pairs` without any label, allowing this dataset to be used out of the box for CachedMultipleNegativesRankingLoss, MultipleNegativesRankingLoss, MultipleNegativesSymmetricRankingLoss, MegaBatchMarginLoss, CachedGISTEmbedLoss, and GISTEmbedLoss, as well as `(sentence_A, sentence_B) pairs` with `class`, `(sentence_A, sentence_B) pairs` with `1 if positive, 0 if negative` and I think even `(sentence_A, sentence_B) pairs` with `float similarity score`.

- Tom Aarsen

Files changed (1) hide show
  1. README.md +1 -0
README.md CHANGED
@@ -64,6 +64,7 @@ configs:
64
  path: positive/test-*
65
  tags:
66
  - code
 
67
  ---
68
 
69
  # GIS: Github Issue Similarity Dataset
 
64
  path: positive/test-*
65
  tags:
66
  - code
67
+ - sentence-transformers
68
  ---
69
 
70
  # GIS: Github Issue Similarity Dataset