Sentence Similarity
Safetensors
sentence-transformers
Turkish
PyLate
modernbert
ColBERT
late-interaction
retrieval
turkish
loss:Distillation
text-embeddings-inference
Instructions to use moganai/Mogan-ColBERT-TR with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use moganai/Mogan-ColBERT-TR with sentence-transformers:
from pylate import models queries = [ "Which planet is known as the Red Planet?", "What is the largest planet in our solar system?", ] documents = [ ["Mars is the Red Planet.", "Venus is Earth's twin."], ["Jupiter is the largest planet.", "Saturn has rings."], ] model = models.ColBERT(model_name_or_path="moganai/Mogan-ColBERT-TR") queries_emb = model.encode(queries, is_query=True) docs_emb = model.encode(documents, is_query=False) - Notebooks
- Google Colab
- Kaggle
Update model names and cross-links after repo rename
Browse files
README.md
CHANGED
|
@@ -4,7 +4,7 @@ language:
|
|
| 4 |
- tr
|
| 5 |
library_name: PyLate
|
| 6 |
pipeline_tag: sentence-similarity
|
| 7 |
-
base_model: moganai/MoganBERT-
|
| 8 |
tags:
|
| 9 |
- ColBERT
|
| 10 |
- PyLate
|
|
@@ -16,7 +16,7 @@ tags:
|
|
| 16 |
---
|
| 17 |
|
| 18 |
<p align="center">
|
| 19 |
-
<img src="banner.png" alt="
|
| 20 |
</p>
|
| 21 |
|
| 22 |
<p align="center">
|
|
@@ -24,11 +24,11 @@ tags:
|
|
| 24 |
<a href="https://huggingface.co/collections/moganai/moganbert"><img src="https://img.shields.io/badge/🤗_Model_Collection-2C3E50?style=flat-square" alt="Model Collection"/></a>
|
| 25 |
</p>
|
| 26 |
|
| 27 |
-
#
|
| 28 |
|
| 29 |
-
|
| 30 |
|
| 31 |
-
It is initialized from [MoganBERT-
|
| 32 |
|
| 33 |
## Usage
|
| 34 |
|
|
@@ -39,7 +39,7 @@ pip install -U pylate
|
|
| 39 |
```python
|
| 40 |
from pylate import indexes, models, retrieve
|
| 41 |
|
| 42 |
-
model = models.ColBERT(model_name_or_path="moganai/
|
| 43 |
index = indexes.PLAID(index_folder="pylate-index", index_name="index", override=True)
|
| 44 |
|
| 45 |
documents_ids = ["1", "2", "3"]
|
|
@@ -55,13 +55,13 @@ queries_embeddings = model.encode(["örnek sorgu"], batch_size=32, is_query=True
|
|
| 55 |
print(retriever.retrieve(queries_embeddings=queries_embeddings, k=10))
|
| 56 |
```
|
| 57 |
|
| 58 |
-
For reranking use `pylate.rank.rerank`. A multi-vector index is tens of times larger than a dense one, so in production the recommended setup is two-stage: candidate generation with [MoganBERT-
|
| 59 |
|
| 60 |
## Training
|
| 61 |
|
| 62 |
Single-epoch KL distillation from the `bge-reranker-v2-m3` cross-encoder over 1 positive and 7 mined hard negatives, on 1×H100. The optimizer uses two parameter groups — encoder 1e-5, projection 1e-4 — since the projection starts random while the encoder does not.
|
| 63 |
|
| 64 |
-
Training data is title→passage pairs carved out of our pretraining corpus plus two Turkish question-based retrieval sets. Passages are split in the character domain at sentence boundaries rather than by decoding cut token lists. Negatives are mined in the MoganBERT-
|
| 65 |
|
| 66 |
## Results
|
| 67 |
|
|
@@ -76,8 +76,8 @@ Averaged over the five datasets: 31.81 nDCG@10, 35.53 nDCG@100, 56.98 Recall@100
|
|
| 76 |
| Model | Params | Purpose |
|
| 77 |
|---|---:|---|
|
| 78 |
| [MoganBERT-TR](https://huggingface.co/moganai/MoganBERT-TR) | 149.4M | Base encoder |
|
| 79 |
-
| [MoganBERT-
|
| 80 |
-
| [**
|
| 81 |
|
| 82 |
## Citation
|
| 83 |
|
|
@@ -92,11 +92,11 @@ Averaged over the five datasets: 31.81 nDCG@10, 35.53 nDCG@100, 56.98 Recall@100
|
|
| 92 |
---
|
| 93 |
---
|
| 94 |
|
| 95 |
-
#
|
| 96 |
|
| 97 |
-
|
| 98 |
|
| 99 |
-
[MoganBERT-
|
| 100 |
|
| 101 |
## Kullanım
|
| 102 |
|
|
@@ -107,7 +107,7 @@ pip install -U pylate
|
|
| 107 |
```python
|
| 108 |
from pylate import indexes, models, retrieve
|
| 109 |
|
| 110 |
-
model = models.ColBERT(model_name_or_path="moganai/
|
| 111 |
index = indexes.PLAID(index_folder="pylate-index", index_name="index", override=True)
|
| 112 |
|
| 113 |
belge_idleri = ["1", "2", "3"]
|
|
@@ -123,13 +123,13 @@ sorgu_gommeleri = model.encode(["örnek sorgu"], batch_size=32, is_query=True)
|
|
| 123 |
print(retriever.retrieve(queries_embeddings=sorgu_gommeleri, k=10))
|
| 124 |
```
|
| 125 |
|
| 126 |
-
Yeniden sıralama için `pylate.rank.rerank` kullanın. Çok vektörlü indeks yoğun bir indeksten onlarca kat büyüktür; üretimde önerilen kurulum iki aşamalıdır: aday üretimi [MoganBERT-
|
| 127 |
|
| 128 |
## Eğitim
|
| 129 |
|
| 130 |
1×H100 üzerinde, `bge-reranker-v2-m3` çapraz kodlayıcısından 1 pozitif ve 7 zor negatif üzerinde tek epoch'luk KL damıtma. Optimizasyon iki parametre grubu kullanır — encoder 1e-5, izdüşüm 1e-4 — çünkü izdüşüm rastgele başlarken encoder başlamaz.
|
| 131 |
|
| 132 |
-
Eğitim verisi, ön-eğitim külliyatımızdan çıkarılan başlık→pasaj çiftleri ve iki Türkçe soru tabanlı retrieval kümesidir. Pasajlar, kesilmiş token listeleri decode edilerek değil, karakter alanında cümle sınırlarından bölünür. Negatifler MoganBERT-
|
| 133 |
|
| 134 |
## Sonuçlar
|
| 135 |
|
|
@@ -144,8 +144,8 @@ Beş veri kümesinin ortalaması: 31.81 nDCG@10, 35.53 nDCG@100, 56.98 Recall@10
|
|
| 144 |
| Model | Parametre | Amaç |
|
| 145 |
|---|---:|---|
|
| 146 |
| [MoganBERT-TR](https://huggingface.co/moganai/MoganBERT-TR) | 149.4M | Temel encoder |
|
| 147 |
-
| [MoganBERT-
|
| 148 |
-
| [**
|
| 149 |
|
| 150 |
## Atıf
|
| 151 |
|
|
|
|
| 4 |
- tr
|
| 5 |
library_name: PyLate
|
| 6 |
pipeline_tag: sentence-similarity
|
| 7 |
+
base_model: moganai/MoganBERT-Embed
|
| 8 |
tags:
|
| 9 |
- ColBERT
|
| 10 |
- PyLate
|
|
|
|
| 16 |
---
|
| 17 |
|
| 18 |
<p align="center">
|
| 19 |
+
<img src="banner.png" alt="Mogan-ColBERT-TR" width="600"/>
|
| 20 |
</p>
|
| 21 |
|
| 22 |
<p align="center">
|
|
|
|
| 24 |
<a href="https://huggingface.co/collections/moganai/moganbert"><img src="https://img.shields.io/badge/🤗_Model_Collection-2C3E50?style=flat-square" alt="Model Collection"/></a>
|
| 25 |
</p>
|
| 26 |
|
| 27 |
+
# Mogan-ColBERT-TR
|
| 28 |
|
| 29 |
+
Mogan-ColBERT-TR is a 148.9M-parameter Turkish multi-vector retriever with late interaction. Instead of one vector per text, it keeps the representation at the token level through a 768→128 projection and scores with MaxSim. Queries are padded to 32 tokens with `[MASK]`; documents are encoded up to 512.
|
| 30 |
|
| 31 |
+
It is initialized from [MoganBERT-Embed](https://huggingface.co/moganai/MoganBERT-Embed) — a ModernBERT trained from scratch on an entirely Turkish corpus, not a fine-tune of a foreign base.
|
| 32 |
|
| 33 |
## Usage
|
| 34 |
|
|
|
|
| 39 |
```python
|
| 40 |
from pylate import indexes, models, retrieve
|
| 41 |
|
| 42 |
+
model = models.ColBERT(model_name_or_path="moganai/Mogan-ColBERT-TR")
|
| 43 |
index = indexes.PLAID(index_folder="pylate-index", index_name="index", override=True)
|
| 44 |
|
| 45 |
documents_ids = ["1", "2", "3"]
|
|
|
|
| 55 |
print(retriever.retrieve(queries_embeddings=queries_embeddings, k=10))
|
| 56 |
```
|
| 57 |
|
| 58 |
+
For reranking use `pylate.rank.rerank`. A multi-vector index is tens of times larger than a dense one, so in production the recommended setup is two-stage: candidate generation with [MoganBERT-Embed](https://huggingface.co/moganai/MoganBERT-Embed), reranking with this model.
|
| 59 |
|
| 60 |
## Training
|
| 61 |
|
| 62 |
Single-epoch KL distillation from the `bge-reranker-v2-m3` cross-encoder over 1 positive and 7 mined hard negatives, on 1×H100. The optimizer uses two parameter groups — encoder 1e-5, projection 1e-4 — since the projection starts random while the encoder does not.
|
| 63 |
|
| 64 |
+
Training data is title→passage pairs carved out of our pretraining corpus plus two Turkish question-based retrieval sets. Passages are split in the character domain at sentence boundaries rather than by decoding cut token lists. Negatives are mined in the MoganBERT-Embed embedding space and filtered by three rules together: skip the top 10, drop candidates sharing the query's group identifier, and drop anything above 0.95 cosine. The group mask matters — a second passage from the same document ranks high for the same title and is not a negative.
|
| 65 |
|
| 66 |
## Results
|
| 67 |
|
|
|
|
| 76 |
| Model | Params | Purpose |
|
| 77 |
|---|---:|---|
|
| 78 |
| [MoganBERT-TR](https://huggingface.co/moganai/MoganBERT-TR) | 149.4M | Base encoder |
|
| 79 |
+
| [MoganBERT-Embed](https://huggingface.co/moganai/MoganBERT-Embed) | 149M | Single-vector embeddings |
|
| 80 |
+
| [**Mogan-ColBERT-TR**](https://huggingface.co/moganai/Mogan-ColBERT-TR) | 148.9M | Multi-vector retrieval (this model) |
|
| 81 |
|
| 82 |
## Citation
|
| 83 |
|
|
|
|
| 92 |
---
|
| 93 |
---
|
| 94 |
|
| 95 |
+
# Mogan-ColBERT-TR (Türkçe)
|
| 96 |
|
| 97 |
+
Mogan-ColBERT-TR, geç etkileşimli, 148.9M parametreli bir Türkçe çok vektörlü retriever'dır. Metin başına tek vektör yerine temsili 768→128 izdüşümü ile token seviyesinde tutar ve MaxSim ile skorlar. Sorgular `[MASK]` ile 32 tokena tamamlanır, belgeler 512'ye kadar kodlanır.
|
| 98 |
|
| 99 |
+
[MoganBERT-Embed](https://huggingface.co/moganai/MoganBERT-Embed)'den başlatılmıştır — tamamen Türkçe bir külliyat üzerinde sıfırdan eğitilmiş bir ModernBERT; yabancı bir modelin ince ayarı değil.
|
| 100 |
|
| 101 |
## Kullanım
|
| 102 |
|
|
|
|
| 107 |
```python
|
| 108 |
from pylate import indexes, models, retrieve
|
| 109 |
|
| 110 |
+
model = models.ColBERT(model_name_or_path="moganai/Mogan-ColBERT-TR")
|
| 111 |
index = indexes.PLAID(index_folder="pylate-index", index_name="index", override=True)
|
| 112 |
|
| 113 |
belge_idleri = ["1", "2", "3"]
|
|
|
|
| 123 |
print(retriever.retrieve(queries_embeddings=sorgu_gommeleri, k=10))
|
| 124 |
```
|
| 125 |
|
| 126 |
+
Yeniden sıralama için `pylate.rank.rerank` kullanın. Çok vektörlü indeks yoğun bir indeksten onlarca kat büyüktür; üretimde önerilen kurulum iki aşamalıdır: aday üretimi [MoganBERT-Embed](https://huggingface.co/moganai/MoganBERT-Embed) ile, yeniden sıralama bu model ile.
|
| 127 |
|
| 128 |
## Eğitim
|
| 129 |
|
| 130 |
1×H100 üzerinde, `bge-reranker-v2-m3` çapraz kodlayıcısından 1 pozitif ve 7 zor negatif üzerinde tek epoch'luk KL damıtma. Optimizasyon iki parametre grubu kullanır — encoder 1e-5, izdüşüm 1e-4 — çünkü izdüşüm rastgele başlarken encoder başlamaz.
|
| 131 |
|
| 132 |
+
Eğitim verisi, ön-eğitim külliyatımızdan çıkarılan başlık→pasaj çiftleri ve iki Türkçe soru tabanlı retrieval kümesidir. Pasajlar, kesilmiş token listeleri decode edilerek değil, karakter alanında cümle sınırlarından bölünür. Negatifler MoganBERT-Embed gömme uzayında çıkarılır ve üç kural birlikte uygulanarak filtrelenir: ilk 10'u atla, sorgunun grup kimliğini paylaşan adayları düşür, 0.95 kosinüsün üstündekileri düşür. Grup maskesi önemlidir — aynı belgeden çıkan ikinci pasaj aynı başlık için üst sıralara çıkar ve negatif değildir.
|
| 133 |
|
| 134 |
## Sonuçlar
|
| 135 |
|
|
|
|
| 144 |
| Model | Parametre | Amaç |
|
| 145 |
|---|---:|---|
|
| 146 |
| [MoganBERT-TR](https://huggingface.co/moganai/MoganBERT-TR) | 149.4M | Temel encoder |
|
| 147 |
+
| [MoganBERT-Embed](https://huggingface.co/moganai/MoganBERT-Embed) | 149M | Tek vektörlü gömme |
|
| 148 |
+
| [**Mogan-ColBERT-TR**](https://huggingface.co/moganai/Mogan-ColBERT-TR) | 148.9M | Çok vektörlü retrieval (bu model) |
|
| 149 |
|
| 150 |
## Atıf
|
| 151 |
|