Instructions to use rbroc/contrastive-user-encoder-singlepost with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rbroc/contrastive-user-encoder-singlepost with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="rbroc/contrastive-user-encoder-singlepost")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("rbroc/contrastive-user-encoder-singlepost") model = AutoModel.from_pretrained("rbroc/contrastive-user-encoder-singlepost") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -20,7 +20,7 @@ We fine-tuned DistilBERT on triplets consisting of:
|
|
| 20 |
- a post from a different, randomly selected user (the "negative example")
|
| 21 |
|
| 22 |
|
| 23 |
-
To compute the loss, we use [CLS] encoding of the anchor, positive example and negative example from the last layer of the DistilBERT encoder. We optimize for \\(max(||f(a) - f(n)|| - ||
|
| 24 |
|
| 25 |
where:
|
| 26 |
- \\( f(a)\\) is the [CLS] encoding of the anchor;
|
|
|
|
| 20 |
- a post from a different, randomly selected user (the "negative example")
|
| 21 |
|
| 22 |
|
| 23 |
+
To compute the loss, we use [CLS] encoding of the anchor, positive example and negative example from the last layer of the DistilBERT encoder. We optimize for \\(max(||f(a) - f(n)|| - ||f(a) - f(p)|| + \alpha,0)\\)
|
| 24 |
|
| 25 |
where:
|
| 26 |
- \\( f(a)\\) is the [CLS] encoding of the anchor;
|