Sentence Similarity
sentence-transformers
Safetensors
baa-embedding-reranker
retrieval
embeddings
reranker
cross-encoder
rag
Instructions to use baa-ai/Merino-Pro with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use baa-ai/Merino-Pro with sentence-transformers:
from sentence_transformers import CrossEncoder model = CrossEncoder("baa-ai/Merino-Pro") query = "Which planet is known as the Red Planet?" passages = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", "Saturn, famous for its rings, is sometimes mistaken for the Red Planet." ] scores = model.predict([(query, passage) for passage in passages]) print(scores) - Notebooks
- Google Colab
- Kaggle
Rebrand card to Merino-Pro
Browse files- MODEL_CARD.md +37 -32
MODEL_CARD.md
CHANGED
|
@@ -1,42 +1,47 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
## What it is
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
*
|
| 11 |
-
|
| 12 |
-
- **
|
| 13 |
-
- **Rerank role:** cross-encoder. Single relevance logit per (query, doc) pair.
|
| 14 |
-
- **Router:** trivial — call `.embed(...)` or `.rerank(...)`.
|
| 15 |
-
|
| 16 |
-
## Footprint
|
| 17 |
-
~**0.77x** the two separate models (the 256M word-embedding table is stored once and tied at load), with
|
| 18 |
-
**no quality loss** and **no retraining**. Disk: the reranker's word-embedding copy is stripped and injected
|
| 19 |
-
from the embedder at load.
|
| 20 |
-
|
| 21 |
-
## Eval (450-query ML-PDF holdout)
|
| 22 |
-
| Role | hit@3 | note |
|
| 23 |
-
|---|---|---|
|
| 24 |
-
| Embed (dense retrieval) | 0.9511 | == standalone bi-encoder baseline |
|
| 25 |
-
| Rerank (full pipeline) | 0.9511 | == standalone cross-encoder baseline |
|
| 26 |
-
Both identical to the two-model baseline; sharing the word-embedding table is a no-op on quality.
|
| 27 |
|
| 28 |
## Usage
|
|
|
|
| 29 |
```python
|
| 30 |
-
from modeling_baa import BaaEmbeddingReranker
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
| 35 |
```
|
| 36 |
|
| 37 |
-
## License
|
| 38 |
-
|
| 39 |
-
|
| 40 |
- Incorporates the `xlm-roberta-large` backbone under the **MIT License** — see `LICENSE-xlm-roberta-large.txt`.
|
| 41 |
|
| 42 |
-
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: baa-proprietary
|
| 4 |
+
library_name: sentence-transformers
|
| 5 |
+
tags:
|
| 6 |
+
- retrieval
|
| 7 |
+
- embeddings
|
| 8 |
+
- reranker
|
| 9 |
+
- cross-encoder
|
| 10 |
+
- rag
|
| 11 |
+
- sentence-similarity
|
| 12 |
+
pipeline_tag: sentence-similarity
|
| 13 |
+
---
|
| 14 |
|
| 15 |
+
# baa.ai · Merino-Pro
|
| 16 |
+
|
| 17 |
+
**The premium unified retrieval model — bi-encoder embedding *and* cross-encoder reranking in one package, over a single shared word-embedding table.** A 1024-dimensional multilingual model, by BAA AI (Black Sheep AI). ~872M params (fp16, ~1.78 GB).
|
| 18 |
+
|
| 19 |
+
## Get the optimal model for *your* data
|
| 20 |
+
|
| 21 |
+
Merino-Pro is baa.ai's flagship default. But the best embedder + reranker is **corpus-specific** — the ideal choice depends on your documents and your notion of relevance. **baa.ai offers exclusive tooling that identifies the optimal embedding and reranking models for your specific data**, so you ship the smallest models that maximize document recovery on your corpus. For a tailored recommendation, **reach out to baa.ai**.
|
| 22 |
|
| 23 |
## What it is
|
| 24 |
+
|
| 25 |
+
A two-role retrieval model over a **shared input word-embedding matrix** (~256M params, stored once). The bi-encoder embedder and cross-encoder reranker are both built on the `xlm-roberta-large` backbone and **co-trained** to share a single word-embedding table at **no quality loss**, while each role keeps its native layers and head. Footprint ~0.77x the two separate models.
|
| 26 |
+
|
| 27 |
+
- **Embed role:** bi-encoder, 1024-d, L2-normalized. Prepend `"query: "` to queries.
|
| 28 |
+
- **Rerank role:** cross-encoder, single relevance logit per (query, document) pair.
|
| 29 |
+
- **Router:** call `.embed(...)` or `.rerank(...)`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
## Usage
|
| 32 |
+
|
| 33 |
```python
|
| 34 |
+
from modeling_baa import BaaEmbeddingReranker # included in this repo
|
| 35 |
+
|
| 36 |
+
m = BaaEmbeddingReranker("baa-ai/Merino-Pro")
|
| 37 |
+
qv = m.embed(["my query"], is_query=True)[0] # 1024-d normalized
|
| 38 |
+
dv = m.embed(["doc a", "doc b"])
|
| 39 |
+
ranked = m.rerank("my query", ["doc a", "doc b"], top_k=10) # [(doc, score), ...]
|
| 40 |
```
|
| 41 |
|
| 42 |
+
## License & attribution
|
| 43 |
+
|
| 44 |
+
- **BAA Contributions** (shared-embedding architecture, router/loader code, packaging, weights, docs) are **proprietary to BAA AI (Black Sheep AI)** — see `LICENSE`.
|
| 45 |
- Incorporates the `xlm-roberta-large` backbone under the **MIT License** — see `LICENSE-xlm-roberta-large.txt`.
|
| 46 |
|
| 47 |
+
© 2026 BAA AI (Black Sheep AI) — baa.ai. Provided "as is" without warranty.
|