Downloads · 30 days
0
sfidan42/turkish_embedding_fine_tuned_a_enc_best
turkish_embedding_fine_tuned_a_enc_best is a feature extraction model from sfidan42. Use it when you need embeddings to search or compare text. It is set up for sentence-transformers. The card lists the license as apache-2.0.
Fine-tuned from selmanbaysan/turkishembeddingmodelfinetuned using a dual-encoder (bi-encoder) architecture with in-batch contrastive loss on Turkish QA pairs.
Downloads · 30 days
0
Access
Public
Updated May 10, 2026
Repo size
5.4 MB
Likes
0
Public
Click a slice to open those files.
.safetensors5.4 MB · 87%
From the Hugging Face model README
Fine-tuned from selmanbaysan/turkish_embedding_model_fine_tuned using a dual-encoder (bi-encoder) architecture with in-batch contrastive loss on Turkish QA pairs.
c-index (rnk) = 0.8881c-index (rnk) observed during training (not the final epoch).| Repo | Role |
|---|---|
sfidan42/turkish_embedding_fine_tuned_q_enc_best | Query encoder (best epoch) |
sfidan42/turkish_embedding_fine_tuned_a_enc_best | Answer / passage encoder (best epoch) |
sfidan42/Quora_QA_Turkish_First_Answers, sfidan42/Quora_QA_Turkish_Second_Answerssfidan42/Turkish-QA-Rankedfrom transformers import AutoTokenizer, AutoModel
import torch
tokenizer = AutoTokenizer.from_pretrained("sfidan42/turkish_embedding_fine_tuned_a_enc_best")
model = AutoModel.from_pretrained("sfidan42/turkish_embedding_fine_tuned_a_enc_best")
def embed(texts):
enc = tokenizer(texts, padding=True, truncation=True, max_length=128, return_tensors="pt")
with torch.no_grad():
o = model(**enc).last_hidden_state
m = enc["attention_mask"].unsqueeze(-1)
return (o * m).sum(1) / m.sum(1) # mean pooling
query_vec = embed(["Türkiye'nin başkenti neresidir?"])
passage_vec = embed(["Türkiye'nin başkenti Ankara'dır."])
score = torch.nn.functional.cosine_similarity(query_vec, passage_vec)