Sentence Similarity
sentence-transformers
Safetensors
bert
feature-extraction
dense
text-embeddings-inference
Run this model with HF Jobs
Run yosshstd/ProTrek_650M_UniRef50_text_encoder on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/yosshstd/ProTrek_650M_UniRef50_text_encoder. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/yosshstd/ProTrek_650M_UniRef50_text_encoder on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use yosshstd/ProTrek_650M_UniRef50_text_encoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use yosshstd/ProTrek_650M_UniRef50_text_encoder with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("yosshstd/ProTrek_650M_UniRef50_text_encoder") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Upload 13 files
Browse filesFiles changed (13)
- 1_Pooling/config.jsonAdded+10
- 2_Dense/config.jsonAdded+6
- 2_Dense/model.safetensorsAdded+3
- README.md+145-3
- config.jsonAdded+24
- config_sentence_transformers.jsonAdded+14
- model.safetensorsAdded+3
- modules.jsonAdded+26
- sentence_bert_config.jsonAdded+4
- special_tokens_map.jsonAdded+37
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+58
- vocab.txtAdded
12345678910{ "word_embedding_dimension": 768, "pooling_mode_cls_token": true, "pooling_mode_mean_tokens": false, "pooling_mode_max_tokens": false, "pooling_mode_mean_sqrt_len_tokens": false, "pooling_mode_weightedmean_tokens": false, "pooling_mode_lasttoken": false, "include_prompt": true}123456{ "in_features": 768, "out_features": 1024, "bias": true, "activation_function": "torch.nn.modules.linear.Identity"}123version https://git-lfs.github.com/spec/v1oid sha256:c36e5b123a90d0fdbcb33485812be84567082d8fa2879d5ac5f8883edccb7738size 3149984123123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145---
license: mit
------tags:- sentence-transformers- sentence-similarity- feature-extraction- densepipeline_tag: sentence-similaritylibrary_name: sentence-transformers---
# SentenceTransformer
This is a [sentence-transformers](https://www.SBERT.net) model trained. It maps sentences & paragraphs to a 1024-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
## Model Details
### Model Description- **Model Type:** Sentence Transformer<!-- - **Base model:** [Unknown](https://huggingface.co/unknown) -->- **Maximum Sequence Length:** 512 tokens- **Output Dimensionality:** 1024 dimensions- **Similarity Function:** Cosine Similarity<!-- - **Training Dataset:** Unknown --><!-- - **Language:** Unknown --><!-- - **License:** Unknown -->
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```SentenceTransformer( (0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'BertModel'}) (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True}) (2): Dense({'in_features': 768, 'out_features': 1024, 'bias': True, 'activation_function': 'torch.nn.modules.linear.Identity'}) (3): Normalize())```
## Usage
### Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
```bashpip install -U sentence-transformers```
Then you can load this model and run inference.```pythonfrom sentence_transformers import SentenceTransformer
# Download from the 🤗 Hubmodel = SentenceTransformer("sentence_transformers_model_id")# Run inferencesentences = [ 'The weather is lovely today.', "It's so sunny outside!", 'He drove to the stadium.',]embeddings = model.encode(sentences)print(embeddings.shape)# [3, 1024]
# Get the similarity scores for the embeddingssimilarities = model.similarity(embeddings, embeddings)print(similarities)# tensor([[1.0000, 0.7137, 0.6395],# [0.7137, 1.0000, 0.5949],# [0.6395, 0.5949, 1.0000]])```
<!--### Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details>-->
<!--### Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details>-->
<!--### Out-of-Scope Use
*List how the model may foreseeably be misused and address what users ought not to do with the model.*-->
<!--## Bias, Risks and Limitations
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*-->
<!--### Recommendations
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*-->
## Training Details
### Framework Versions- Python: 3.11.11- Sentence Transformers: 5.0.0- Transformers: 4.53.2- PyTorch: 2.2.1+cu121- Accelerate: - Datasets: - Tokenizers: 0.21.2
## Citation
### BibTeX
<!--## Glossary
*Clearly define terms in order to be accessible across audiences.*-->
<!--## Model Card Authors
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*-->
<!--## Model Card Contact
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*-->123456789101112131415161718192021222324{ "architectures": [ "BertModel" ], "attention_probs_dropout_prob": 0.1, "classifier_dropout": null, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 768, "initializer_range": 0.02, "intermediate_size": 3072, "layer_norm_eps": 1e-12, "max_position_embeddings": 512, "model_type": "bert", "num_attention_heads": 12, "num_hidden_layers": 12, "pad_token_id": 0, "position_embedding_type": "absolute", "torch_dtype": "float32", "transformers_version": "4.53.2", "type_vocab_size": 2, "use_cache": true, "vocab_size": 30522}1234567891011121314{ "model_type": "SentenceTransformer", "__version__": { "sentence_transformers": "5.0.0", "transformers": "4.53.2", "pytorch": "2.2.1+cu121" }, "prompts": { "query": "", "document": "" }, "default_prompt_name": null, "similarity_fn_name": "cosine"}123version https://git-lfs.github.com/spec/v1oid sha256:3c3a085e80996d81853fa082ef234417de7e029921037623dffb0756c18782acsize 4379513281234567891011121314151617181920212223242526[ { "idx": 0, "name": "0", "path": "", "type": "sentence_transformers.models.Transformer" }, { "idx": 1, "name": "1", "path": "1_Pooling", "type": "sentence_transformers.models.Pooling" }, { "idx": 2, "name": "2", "path": "2_Dense", "type": "sentence_transformers.models.Dense" }, { "idx": 3, "name": "3", "path": "3_Normalize", "type": "sentence_transformers.models.Normalize" }]1234{ "max_seq_length": 512, "do_lower_case": false}12345678910111213141516171819202122232425262728293031323334353637{ "cls_token": { "content": "[CLS]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "mask_token": { "content": "[MASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "pad_token": { "content": "[PAD]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "sep_token": { "content": "[SEP]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "unk_token": { "content": "[UNK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758{ "added_tokens_decoder": { "0": { "content": "[PAD]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "[UNK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "2": { "content": "[CLS]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "3": { "content": "[SEP]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "4": { "content": "[MASK]", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "clean_up_tokenization_spaces": true, "cls_token": "[CLS]", "do_basic_tokenize": true, "do_lower_case": true, "extra_special_tokens": {}, "mask_token": "[MASK]", "model_max_length": 1000000000000000019884624838656, "never_split": null, "pad_token": "[PAD]", "sep_token": "[SEP]", "strip_accents": null, "tokenize_chinese_chars": true, "tokenizer_class": "BertTokenizer", "unk_token": "[UNK]"}1_Pooling/config.jsonAdded+10
2_Dense/config.jsonAdded+6
2_Dense/model.safetensorsAdded+3
README.md+145-3
config.jsonAdded+24
config_sentence_transformers.jsonAdded+14
model.safetensorsAdded+3
modules.jsonAdded+26
sentence_bert_config.jsonAdded+4
special_tokens_map.jsonAdded+37
tokenizer.jsonAdded
tokenizer_config.jsonAdded+58
vocab.txtAdded