Created model card
#2
by
Anush008
- opened
README.md
CHANGED
|
@@ -1,4 +1,34 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
| 3 |
---
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
pipeline_tag: sentence-similarity
|
| 4 |
---
|
| 5 |
+
|
| 6 |
+
ONNX port of [prithivida/Splade_PP_en_v1](https://huggingface.co/prithivida/Splade_PP_en_v1) for text classification and similarity searches.
|
| 7 |
+
|
| 8 |
+
### Usage
|
| 9 |
+
|
| 10 |
+
Here's an example of performing inference using the model with [FastEmbed](https://github.com/qdrant/fastembed).
|
| 11 |
+
|
| 12 |
+
```py
|
| 13 |
+
from fastembed import SparseTextEmbedding
|
| 14 |
+
|
| 15 |
+
documents = [
|
| 16 |
+
"You should stay, study and sprint.",
|
| 17 |
+
"History can only prepare us to be surprised yet again.",
|
| 18 |
+
]
|
| 19 |
+
|
| 20 |
+
model = SparseTextEmbedding(model_name="prithivida/Splade_PP_en_v1")
|
| 21 |
+
embeddings = list(model.embed(documents))
|
| 22 |
+
|
| 23 |
+
# [
|
| 24 |
+
# SparseEmbedding(values=array(
|
| 25 |
+
# [0.45940185, 0.64054322, 0.2425732, 0.1623179, 1.20566428,
|
| 26 |
+
# 0.62039357...]),
|
| 27 |
+
# indices=array([1012, 1998, 2000, 2005, 2017, 2022...])),
|
| 28 |
+
# SparseEmbedding(values=array([
|
| 29 |
+
# 0.09767706, 0.4374367, 0.00468039, 1.01167965, 1.02318227, 1.30155718
|
| 30 |
+
# ...]),
|
| 31 |
+
# indices=array([2017, 2022, 2025, 2057, 2064, 2069...]))
|
| 32 |
+
# ]
|
| 33 |
+
|
| 34 |
+
```
|