Added sample colab code to README
Browse files
README.md
CHANGED
@@ -11,7 +11,7 @@ license: mit
|
|
11 |
pipeline_tag: feature-extraction
|
12 |
---
|
13 |
|
14 |
-
# VectorPath SearchMap: Conversational Search Embedding Model
|
15 |
|
16 |
## Model Description
|
17 |
|
@@ -25,6 +25,10 @@ SearchMap is a specialized embedding model designed to change search by making i
|
|
25 |
- Efficient 1024-dimensional embeddings (configurable up to 8192)
|
26 |
- Specialized for product and hotel search scenarios
|
27 |
|
|
|
|
|
|
|
|
|
28 |
## Model Details
|
29 |
|
30 |
- Base Model: Stella Embed 400M v5
|
@@ -35,17 +39,16 @@ SearchMap is a specialized embedding model designed to change search by making i
|
|
35 |
|
36 |
## Usage
|
37 |
|
38 |
-
### Using
|
39 |
|
40 |
```python
|
41 |
-
|
|
|
|
|
|
|
42 |
|
43 |
# Initialize the model
|
44 |
-
model =
|
45 |
-
'vectorpath/searchmap-v1',
|
46 |
-
query_instruction_for_retrieval="Generate a representation for this search query that can be used to retrieve related ecommerce products:",
|
47 |
-
use_fp16=True
|
48 |
-
)
|
49 |
|
50 |
# Encode queries
|
51 |
query = "A treat my dog and I can eat together"
|
@@ -67,13 +70,13 @@ embedding_dimension = 1024 # or your chosen dimension
|
|
67 |
index = faiss.IndexFlatL2(embedding_dimension)
|
68 |
|
69 |
# Add product embeddings
|
70 |
-
product_embeddings = model.encode(product_descriptions)
|
71 |
index.add(np.array(product_embeddings).astype('float32'))
|
72 |
|
73 |
# Search
|
74 |
-
query_embedding = model.encode(query)
|
75 |
distances, indices = index.search(
|
76 |
-
np.array(
|
77 |
k=10
|
78 |
)
|
79 |
```
|
@@ -103,7 +106,7 @@ The model excels at understanding natural language queries like:
|
|
103 |
## Training Details
|
104 |
|
105 |
The model was trained using:
|
106 |
-
- Supervised learning with
|
107 |
- 100,000+ product dataset across 32 categories
|
108 |
- AI-generated conversational search queries
|
109 |
- Positive and negative product examples for contrast learning
|
@@ -135,6 +138,7 @@ If you use this model in your research, please cite:
|
|
135 |
|
136 |
- Discord Community: [Join our Discord](https://discord.gg/9XTrys4f)
|
137 |
- GitHub Issues: Report bugs and feature requests
|
|
|
138 |
|
139 |
## License
|
140 |
|
|
|
11 |
pipeline_tag: feature-extraction
|
12 |
---
|
13 |
|
14 |
+
# VectorPath SearchMap: Conversational E-commerce Search Embedding Model
|
15 |
|
16 |
## Model Description
|
17 |
|
|
|
25 |
- Efficient 1024-dimensional embeddings (configurable up to 8192)
|
26 |
- Specialized for product and hotel search scenarios
|
27 |
|
28 |
+
## Quick Start
|
29 |
+
|
30 |
+
Try out the model in our interactive [Colab Demo](https://colab.research.google.com/drive/1wUQlWgL5R65orhw6MFChxitabqTKIGRu?usp=sharing)!
|
31 |
+
|
32 |
## Model Details
|
33 |
|
34 |
- Base Model: Stella Embed 400M v5
|
|
|
39 |
|
40 |
## Usage
|
41 |
|
42 |
+
### Using Sentence Transformers
|
43 |
|
44 |
```python
|
45 |
+
# Install required packages
|
46 |
+
!pip install -U torch==2.5.1 transformers==4.44.2 sentence-transformers==2.7.0 xformers==0.0.28.post3
|
47 |
+
|
48 |
+
from sentence_transformers import SentenceTransformer
|
49 |
|
50 |
# Initialize the model
|
51 |
+
model = SentenceTransformer('vectopath/SearchMap_Preview', trust_remote_code=True)
|
|
|
|
|
|
|
|
|
52 |
|
53 |
# Encode queries
|
54 |
query = "A treat my dog and I can eat together"
|
|
|
70 |
index = faiss.IndexFlatL2(embedding_dimension)
|
71 |
|
72 |
# Add product embeddings
|
73 |
+
product_embeddings = model.encode(product_descriptions, show_progress_bar=True)
|
74 |
index.add(np.array(product_embeddings).astype('float32'))
|
75 |
|
76 |
# Search
|
77 |
+
query_embedding = model.encode([query])
|
78 |
distances, indices = index.search(
|
79 |
+
np.array(query_embedding).astype('float32'),
|
80 |
k=10
|
81 |
)
|
82 |
```
|
|
|
106 |
## Training Details
|
107 |
|
108 |
The model was trained using:
|
109 |
+
- Supervised learning with Sentence Transformers
|
110 |
- 100,000+ product dataset across 32 categories
|
111 |
- AI-generated conversational search queries
|
112 |
- Positive and negative product examples for contrast learning
|
|
|
138 |
|
139 |
- Discord Community: [Join our Discord](https://discord.gg/9XTrys4f)
|
140 |
- GitHub Issues: Report bugs and feature requests
|
141 |
+
- Interactive Demo: [Try it on Colab](https://colab.research.google.com/drive/1wUQlWgL5R65orhw6MFChxitabqTKIGRu?usp=sharing)
|
142 |
|
143 |
## License
|
144 |
|