Sentence Similarity
sentence-transformers
Safetensors
bert
information-retrieval
biomedical
metasyn
text-embeddings-inference
Instructions to use BFTree/MA-Retriever with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use BFTree/MA-Retriever with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("BFTree/MA-Retriever") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Improve model card
Browse files
README.md
CHANGED
|
@@ -57,13 +57,13 @@ similarity over normalized embeddings.
|
|
| 57 |
|
| 58 |
## Training
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
|
| 68 |
There are 5,585 constructed training pairs. The sentence-transformers training
|
| 69 |
loader used 5,568 examples in complete batches during the epoch; this accounts
|
|
@@ -74,14 +74,10 @@ for the smaller sample count shown by automatically generated trainer metadata.
|
|
| 74 |
All metrics are macro-averaged over the 86 held-out reviews after removing the
|
| 75 |
source review itself from each ranking.
|
| 76 |
|
| 77 |
-
| K |
|
| 78 |
-
|---:|---:|---:|
|
| 79 |
-
|
|
| 80 |
-
|
|
| 81 |
-
| 20 | 53.5% | 34.0% |
|
| 82 |
-
| 50 | 75.3% | 22.6% |
|
| 83 |
-
| 100 | 84.2% | 14.0% |
|
| 84 |
-
| 200 | 91.7% | 8.4% |
|
| 85 |
|
| 86 |
The source-review split is disjoint, and every article linked to a test review
|
| 87 |
is excluded as a positive retriever-training example.
|
|
|
|
| 57 |
|
| 58 |
## Training
|
| 59 |
|
| 60 |
+
We used 40 reviews sampled from the training split to select the epoch count.
|
| 61 |
+
Recall@20 is the primary metric, with Recall@100 and Recall@200 used as
|
| 62 |
+
tie-breakers. The released checkpoint was retrained for one epoch using the
|
| 63 |
+
full training split with Multiple Negatives Ranking Loss, batch size 64,
|
| 64 |
+
learning rate 2e-5, maximum sequence length 512, and seed 718. After excluding
|
| 65 |
+
articles linked to a test review, 334 of the 336 training reviews contribute
|
| 66 |
+
positive pairs.
|
| 67 |
|
| 68 |
There are 5,585 constructed training pairs. The sentence-transformers training
|
| 69 |
loader used 5,568 examples in complete batches during the epoch; this accounts
|
|
|
|
| 74 |
All metrics are macro-averaged over the 86 held-out reviews after removing the
|
| 75 |
source review itself from each ranking.
|
| 76 |
|
| 77 |
+
| Metric | K=5 | K=10 | K=20 | K=50 | K=100 | K=200 |
|
| 78 |
+
|:--|--:|--:|--:|--:|--:|--:|
|
| 79 |
+
| Recall@K | 24.0% | 38.8% | 53.5% | 75.3% | 84.2% | 91.7% |
|
| 80 |
+
| Precision@K | 47.9% | 42.0% | 34.0% | 22.6% | 14.0% | 8.4% |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
The source-review split is disjoint, and every article linked to a test review
|
| 83 |
is excluded as a positive retriever-training example.
|