Sentence Similarity
sentence-transformers
Safetensors
Persian
xlm-roberta
feature-extraction
persian
farsi
matryoshka
text-embeddings-inference
Instructions to use hanyeh00/hamsan with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use hanyeh00/hamsan with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("hanyeh00/hamsan") sentences = [ "query: پایتخت ایران کجاست؟", "passage: تهران پایتخت و پرجمعیتترین شهر ایران است.", "passage: اصفهان یکی از شهرهای تاریخی ایران است.", "passage: دریای خزر بزرگترین دریاچهٔ جهان است." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Download modules.json from hanyeh00/hamsan: direct link, hf CLI and curl.
- Browser
- Download file 432 Bytes
-
https://huggingface.co/hanyeh00/hamsan/resolve/main/modules.json
- Command line
-
hf download hf://hanyeh00/hamsan/modules.json
-
curl -L -o modules.json https://huggingface.co/hanyeh00/hamsan/resolve/main/modules.json
432 Bytes
| [ | |
| { | |
| "idx": 0, | |
| "name": "0", | |
| "path": "", | |
| "type": "sentence_transformers.base.modules.transformer.Transformer" | |
| }, | |
| { | |
| "idx": 1, | |
| "name": "1", | |
| "path": "1_Pooling", | |
| "type": "sentence_transformers.sentence_transformer.modules.pooling.Pooling" | |
| }, | |
| { | |
| "idx": 2, | |
| "name": "2", | |
| "path": "2_Normalize", | |
| "type": "sentence_transformers.base.modules.normalize.Normalize" | |
| } | |
| ] |