Add new SentenceTransformer model
Browse files- 0_StaticEmbedding/model.safetensors +3 -0
- 0_StaticEmbedding/tokenizer.json +0 -0
- README.md +142 -0
- config_sentence_transformers.json +10 -0
- modules.json +8 -0
0_StaticEmbedding/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:24dcd5075c7c25dfe89f74a0b00f9bd45d7f0d6ed6ea4e3b31fca502b418314b
|
| 3 |
+
size 30236768
|
0_StaticEmbedding/tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: BAAI/bge-base-en-v1.5
|
| 3 |
+
library_name: sentence-transformers
|
| 4 |
+
pipeline_tag: sentence-similarity
|
| 5 |
+
tags:
|
| 6 |
+
- sentence-transformers
|
| 7 |
+
- sentence-similarity
|
| 8 |
+
- feature-extraction
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# SentenceTransformer based on BAAI/bge-base-en-v1.5
|
| 12 |
+
|
| 13 |
+
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5). It maps sentences & paragraphs to a 256-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
|
| 14 |
+
|
| 15 |
+
## Model Details
|
| 16 |
+
|
| 17 |
+
### Model Description
|
| 18 |
+
- **Model Type:** Sentence Transformer
|
| 19 |
+
- **Base model:** [BAAI/bge-base-en-v1.5](https://huggingface.co/BAAI/bge-base-en-v1.5) <!-- at revision a5beb1e3e68b9ab74eb54cfd186867f64f240e1a -->
|
| 20 |
+
- **Maximum Sequence Length:** inf tokens
|
| 21 |
+
- **Output Dimensionality:** 256 tokens
|
| 22 |
+
- **Similarity Function:** Cosine Similarity
|
| 23 |
+
<!-- - **Training Dataset:** Unknown -->
|
| 24 |
+
<!-- - **Language:** Unknown -->
|
| 25 |
+
<!-- - **License:** Unknown -->
|
| 26 |
+
|
| 27 |
+
### Model Sources
|
| 28 |
+
|
| 29 |
+
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
|
| 30 |
+
- **Repository:** [Sentence Transformers on GitHub](https://github.com/UKPLab/sentence-transformers)
|
| 31 |
+
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
| 32 |
+
|
| 33 |
+
### Full Model Architecture
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
SentenceTransformer(
|
| 37 |
+
(0): StaticEmbedding(
|
| 38 |
+
(embedding): EmbeddingBag(29528, 256, mode='mean')
|
| 39 |
+
)
|
| 40 |
+
)
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
## Usage
|
| 44 |
+
|
| 45 |
+
### Direct Usage (Sentence Transformers)
|
| 46 |
+
|
| 47 |
+
First install the Sentence Transformers library:
|
| 48 |
+
|
| 49 |
+
```bash
|
| 50 |
+
pip install -U sentence-transformers
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
Then you can load this model and run inference.
|
| 54 |
+
```python
|
| 55 |
+
from sentence_transformers import SentenceTransformer
|
| 56 |
+
|
| 57 |
+
# Download from the 🤗 Hub
|
| 58 |
+
model = SentenceTransformer("joshcx/static_embedding")
|
| 59 |
+
# Run inference
|
| 60 |
+
sentences = [
|
| 61 |
+
'The weather is lovely today.',
|
| 62 |
+
"It's so sunny outside!",
|
| 63 |
+
'He drove to the stadium.',
|
| 64 |
+
]
|
| 65 |
+
embeddings = model.encode(sentences)
|
| 66 |
+
print(embeddings.shape)
|
| 67 |
+
# [3, 256]
|
| 68 |
+
|
| 69 |
+
# Get the similarity scores for the embeddings
|
| 70 |
+
similarities = model.similarity(embeddings, embeddings)
|
| 71 |
+
print(similarities.shape)
|
| 72 |
+
# [3, 3]
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
<!--
|
| 76 |
+
### Direct Usage (Transformers)
|
| 77 |
+
|
| 78 |
+
<details><summary>Click to see the direct usage in Transformers</summary>
|
| 79 |
+
|
| 80 |
+
</details>
|
| 81 |
+
-->
|
| 82 |
+
|
| 83 |
+
<!--
|
| 84 |
+
### Downstream Usage (Sentence Transformers)
|
| 85 |
+
|
| 86 |
+
You can finetune this model on your own dataset.
|
| 87 |
+
|
| 88 |
+
<details><summary>Click to expand</summary>
|
| 89 |
+
|
| 90 |
+
</details>
|
| 91 |
+
-->
|
| 92 |
+
|
| 93 |
+
<!--
|
| 94 |
+
### Out-of-Scope Use
|
| 95 |
+
|
| 96 |
+
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 97 |
+
-->
|
| 98 |
+
|
| 99 |
+
<!--
|
| 100 |
+
## Bias, Risks and Limitations
|
| 101 |
+
|
| 102 |
+
*What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
|
| 103 |
+
-->
|
| 104 |
+
|
| 105 |
+
<!--
|
| 106 |
+
### Recommendations
|
| 107 |
+
|
| 108 |
+
*What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
|
| 109 |
+
-->
|
| 110 |
+
|
| 111 |
+
## Training Details
|
| 112 |
+
|
| 113 |
+
### Framework Versions
|
| 114 |
+
- Python: 3.11.7
|
| 115 |
+
- Sentence Transformers: 3.2.0
|
| 116 |
+
- Transformers: 4.45.2
|
| 117 |
+
- PyTorch: 2.1.2
|
| 118 |
+
- Accelerate: 0.29.2
|
| 119 |
+
- Datasets: 2.16.1
|
| 120 |
+
- Tokenizers: 0.20.1
|
| 121 |
+
|
| 122 |
+
## Citation
|
| 123 |
+
|
| 124 |
+
### BibTeX
|
| 125 |
+
|
| 126 |
+
<!--
|
| 127 |
+
## Glossary
|
| 128 |
+
|
| 129 |
+
*Clearly define terms in order to be accessible across audiences.*
|
| 130 |
+
-->
|
| 131 |
+
|
| 132 |
+
<!--
|
| 133 |
+
## Model Card Authors
|
| 134 |
+
|
| 135 |
+
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
| 136 |
+
-->
|
| 137 |
+
|
| 138 |
+
<!--
|
| 139 |
+
## Model Card Contact
|
| 140 |
+
|
| 141 |
+
*Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
|
| 142 |
+
-->
|
config_sentence_transformers.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"__version__": {
|
| 3 |
+
"sentence_transformers": "3.2.0",
|
| 4 |
+
"transformers": "4.45.2",
|
| 5 |
+
"pytorch": "2.1.2"
|
| 6 |
+
},
|
| 7 |
+
"prompts": {},
|
| 8 |
+
"default_prompt_name": null,
|
| 9 |
+
"similarity_fn_name": null
|
| 10 |
+
}
|
modules.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"idx": 0,
|
| 4 |
+
"name": "0",
|
| 5 |
+
"path": "0_StaticEmbedding",
|
| 6 |
+
"type": "sentence_transformers.models.StaticEmbedding"
|
| 7 |
+
}
|
| 8 |
+
]
|