Downloads · 30 days
49
2% of all-time downloads
fkrasnov2/SBE
SBE is a sentence similarity model from fkrasnov2. Use it when you need a score for how close two texts are. The card lists the license as unlicense.
A sentencepiece tokenizer was applied to a corpus of 269 million Russian search queries.
Downloads · 30 days
49
2% of all-time downloads
All-time downloads
2.2K
Public
Parameters
14.7M
118 MB on disk
Likes
3
Public
Click a slice to open those files.
.safetensors58.8 MB · 50%
From the Hugging Face model README
A sentencepiece tokenizer was applied to a corpus of 269 million Russian search queries.
The encoder-model was trained for the e-commerce search query similarity task, and the search queries were short.
The dataset for validation, which was manually annotated, comprised 362,000 instances.
## don't forget
# pip install protobuf sentencepiece
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained('fkrasnov2/SBE')
tokenizer = AutoTokenizer.from_pretrained('fkrasnov2/SBE')
input_ids = tokenizer.encode("чёрное платье", max_length=model.config.max_position_embeddings, truncation=True, return_tensors='pt')
model.eval()
vector = model(input_ids=input_ids, attention_mask=input_ids!=tokenizer.pad_token_id)[0][0,0]
assert model.config.hidden_size == vector.shape[0]
This model is designed for use in e-commerce IR and helps differentiate products.
The same products:
cos ( SBE("apple 16 синий про макс 256"), SBE("iphone 16 синий pro max 256") ) = 0.96
cos ( SBE("iphone 15 pro max"), SBE("айфон 15 про макс") ) = 0.98
Different products: