Feature Extraction
sentence-transformers
Safetensors
English
modernvbert
sparse-retrieval
splade
visual-document-retrieval
multimodal
information-retrieval
inference-free
sparse-encoder
custom_code
Instructions to use naver/v-splade-efficient with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use naver/v-splade-efficient with sentence-transformers:
from sentence_transformers import SparseEncoder model = SparseEncoder("naver/v-splade-efficient", trust_remote_code=True) queries = ["Which planet is known as the Red Planet?"] documents = [ "Venus is often called Earth's twin because of its similar size and proximity.", "Mars, known for its reddish appearance, is often referred to as the Red Planet.", "Jupiter, the largest planet in our solar system, has a prominent red spot.", ] query_embeddings = model.encode_query(queries) document_embeddings = model.encode_document(documents) similarities = model.similarity(query_embeddings, document_embeddings) print(similarities) - Notebooks
- Google Colab
- Kaggle
README: library_name -> sentence-transformers; human-readable tokens in decode snippet
Browse files
README.md
CHANGED
|
@@ -11,7 +11,7 @@ tags:
|
|
| 11 |
- inference-free
|
| 12 |
- sentence-transformers
|
| 13 |
pipeline_tag: feature-extraction
|
| 14 |
-
library_name: transformers
|
| 15 |
---
|
| 16 |
|
| 17 |
<p align="center">
|
|
@@ -98,8 +98,8 @@ print(similarities)
|
|
| 98 |
|
| 99 |
# Inspect the top activated tokens of the page image
|
| 100 |
decoded = model.decode(document_embeddings[0], top_k=5)
|
| 101 |
-
print([(token, round(weight, 3)) for token, weight in decoded])
|
| 102 |
-
# [('
|
| 103 |
```
|
| 104 |
|
| 105 |
Images can be passed as PIL images, local paths, URLs (as above), or together with text as `{"image": ..., "text": ...}`. Plain text documents are also supported: `model.encode_document(["some passage text"])`. The model runs in bfloat16 by default. You can pass `model_kwargs={"torch_dtype": "float32"}` for full precision.
|
|
|
|
| 11 |
- inference-free
|
| 12 |
- sentence-transformers
|
| 13 |
pipeline_tag: feature-extraction
|
| 14 |
+
library_name: sentence-transformers
|
| 15 |
---
|
| 16 |
|
| 17 |
<p align="center">
|
|
|
|
| 98 |
|
| 99 |
# Inspect the top activated tokens of the page image
|
| 100 |
decoded = model.decode(document_embeddings[0], top_k=5)
|
| 101 |
+
print([(token.replace("Ġ", " ").strip(), round(weight, 3)) for token, weight in decoded])
|
| 102 |
+
# [('dog', 1.664), ('Records', 1.5), ('puppy', 1.469), ('Bennett', 1.414), ('dogs', 1.398)]
|
| 103 |
```
|
| 104 |
|
| 105 |
Images can be passed as PIL images, local paths, URLs (as above), or together with text as `{"image": ..., "text": ...}`. Plain text documents are also supported: `model.encode_document(["some passage text"])`. The model runs in bfloat16 by default. You can pass `model_kwargs={"torch_dtype": "float32"}` for full precision.
|