File size: 2,410 Bytes
60fb1a8
 
 
 
 
fa7aca3
9e63c14
60fb1a8
 
 
 
 
 
9e63c14
60fb1a8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9e63c14
44da06a
9e63c14
 
 
 
 
 
 
 
 
 
 
 
4236274
9e63c14
 
 
 
 
 
 
 
 
 
 
 
 
 
481cd64
 
 
 
 
3a9c699
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- tiny
base_model: sentence-transformers/all-MiniLM-L6-v2
pipeline_tag: sentence-similarity
library_name: sentence-transformers
metrics:
- pearson_cosine
- spearman_cosine
model-index:
- name: SentenceTransformer based on sentence-transformers/all-MiniLM-L6-v2
  results:
  - task:
      type: semantic-similarity
      name: Semantic Similarity
    dataset:
      name: Unknown
      type: unknown
    metrics:
    - type: pearson_cosine
      value: 0.6751697498221416
      name: Pearson Cosine
    - type: spearman_cosine
      value: 0.7044137530273638
      name: Spearman Cosine
---

# Super small embedding model (only 4MB!)

First install the Sentence Transformers library:

```bash
pip install -U sentence-transformers
```

Then you can load this model and run inference.
```python
from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("tabularisai/Zip-1")
# Run inference
sentences = [
    'The weather is lovely today.',
    "It's so sunny outside!",
    'He drove to the stadium.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 32]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

print(similarities)
#tensor([[1.0000, 0.7272, 0.2864],
#        [0.7272, 1.0000, 0.2265],
#        [0.2864, 0.2265, 1.0000]])
```




<table align="center">
  <tr>
    <td align="center">
      <a href="https://www.linkedin.com/company/tabularis-ai/">
        <img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/linkedin.svg" alt="LinkedIn" width="30" height="30">
      </a>
    </td>
    <td align="center">
      <a href="https://x.com/tabularis_ai">
        <img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/x.svg" alt="X" width="30" height="30">
      </a>
    </td>
    <td align="center">
      <a href="https://github.com/tabularis-ai">
        <img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/github.svg" alt="GitHub" width="30" height="30">
      </a>
    </td>
    <td align="center">
      <a href="https://tabularis.ai">
        <img src="https://cdn.jsdelivr.net/gh/simple-icons/simple-icons/icons/internetarchive.svg" alt="Website" width="30" height="30">
      </a>
    </td>
  </tr>
</table>