Update README.md
Browse files
README.md
CHANGED
|
@@ -2,13 +2,15 @@
|
|
| 2 |
license: apache-2.0
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
-
pipeline_tag:
|
| 6 |
tags:
|
| 7 |
-
-
|
| 8 |
-
-
|
| 9 |
-
-
|
| 10 |
-
-
|
| 11 |
-
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
<div align="center">
|
|
@@ -17,107 +19,248 @@ library_name: transformers
|
|
| 17 |
|
| 18 |
---
|
| 19 |
|
| 20 |
-
# Helion-V1-
|
| 21 |
|
| 22 |
-
Helion-V1-
|
| 23 |
|
| 24 |
## Model Description
|
| 25 |
|
| 26 |
- **Developed by:** DeepXR
|
| 27 |
-
- **Model type:**
|
| 28 |
-
- **
|
|
|
|
| 29 |
- **License:** Apache 2.0
|
| 30 |
-
- **
|
|
|
|
| 31 |
|
| 32 |
## Intended Use
|
| 33 |
|
| 34 |
-
Helion-V1-
|
| 35 |
-
-
|
| 36 |
-
-
|
| 37 |
-
-
|
| 38 |
-
-
|
| 39 |
-
-
|
|
|
|
| 40 |
|
| 41 |
-
###
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
-
|
| 44 |
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
-
- Generating harmful, illegal, or unethical content
|
| 49 |
-
- Medical, legal, or financial advice without proper disclaimers
|
| 50 |
-
- Impersonating individuals or organizations
|
| 51 |
-
- Creating misleading or false information
|
| 52 |
|
| 53 |
-
|
| 54 |
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
-
## Usage
|
| 62 |
```python
|
| 63 |
-
from
|
| 64 |
|
| 65 |
-
|
| 66 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 67 |
-
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
]
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
|
|
|
|
|
|
| 77 |
```
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
## Training Details
|
| 80 |
|
| 81 |
### Training Data
|
| 82 |
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
|
| 85 |
### Training Procedure
|
| 86 |
|
| 87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
-
##
|
| 90 |
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
-
|
| 94 |
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
-
|
| 98 |
-
- Performance may vary across different domains
|
| 99 |
-
- Context window is limited
|
| 100 |
-
- May reflect biases present in training data
|
| 101 |
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
-
|
| 105 |
-
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
|
| 110 |
## Citation
|
|
|
|
| 111 |
```bibtex
|
| 112 |
@misc{helion-v1-embeddings,
|
| 113 |
author = {DeepXR},
|
| 114 |
-
title = {Helion-V1:
|
| 115 |
-
year = {
|
| 116 |
publisher = {HuggingFace},
|
| 117 |
url = {https://huggingface.co/DeepXR/Helion-V1-embeddings}
|
| 118 |
}
|
| 119 |
```
|
| 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
## Contact
|
| 122 |
|
| 123 |
-
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
language:
|
| 4 |
- en
|
| 5 |
+
pipeline_tag: sentence-similarity
|
| 6 |
tags:
|
| 7 |
+
- sentence-transformers
|
| 8 |
+
- feature-extraction
|
| 9 |
+
- sentence-similarity
|
| 10 |
+
- embeddings
|
| 11 |
+
- text-embeddings
|
| 12 |
+
library_name: sentence-transformers
|
| 13 |
+
base_model: sentence-transformers/all-MiniLM-L6-v2
|
| 14 |
---
|
| 15 |
|
| 16 |
<div align="center">
|
|
|
|
| 19 |
|
| 20 |
---
|
| 21 |
|
| 22 |
+
# Helion-V1-Embeddings
|
| 23 |
|
| 24 |
+
Helion-V1-Embeddings is a lightweight text embedding model designed for semantic similarity, search, and retrieval tasks. It converts text into dense vector representations optimized for the Helion ecosystem.
|
| 25 |
|
| 26 |
## Model Description
|
| 27 |
|
| 28 |
- **Developed by:** DeepXR
|
| 29 |
+
- **Model type:** Sentence Transformer / Text Embedding Model
|
| 30 |
+
- **Base model:** sentence-transformers/all-MiniLM-L6-v2
|
| 31 |
+
- **Language:** English
|
| 32 |
- **License:** Apache 2.0
|
| 33 |
+
- **Embedding Dimension:** 384
|
| 34 |
+
- **Max Sequence Length:** 256 tokens
|
| 35 |
|
| 36 |
## Intended Use
|
| 37 |
|
| 38 |
+
Helion-V1-Embeddings is designed for:
|
| 39 |
+
- Semantic search and information retrieval
|
| 40 |
+
- Document similarity comparison
|
| 41 |
+
- Clustering and categorization
|
| 42 |
+
- Question-answering systems (retrieval component)
|
| 43 |
+
- Recommendation systems
|
| 44 |
+
- Duplicate detection
|
| 45 |
|
| 46 |
+
### Primary Users
|
| 47 |
+
- Developers building search systems
|
| 48 |
+
- Data scientists working on NLP tasks
|
| 49 |
+
- Applications requiring text similarity
|
| 50 |
+
- RAG (Retrieval-Augmented Generation) pipelines
|
| 51 |
|
| 52 |
+
## Key Features
|
| 53 |
|
| 54 |
+
- **Fast Inference**: Optimized for quick embedding generation
|
| 55 |
+
- **Compact Size**: Small model footprint (~80MB)
|
| 56 |
+
- **Good Performance**: Balanced accuracy and speed
|
| 57 |
+
- **Easy Integration**: Compatible with sentence-transformers library
|
| 58 |
+
- **Batch Processing**: Efficient for large datasets
|
| 59 |
|
| 60 |
+
## Usage
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
### Basic Usage
|
| 63 |
|
| 64 |
+
```python
|
| 65 |
+
from sentence_transformers import SentenceTransformer
|
| 66 |
+
|
| 67 |
+
# Load model
|
| 68 |
+
model = SentenceTransformer('DeepXR/Helion-V1-embeddings')
|
| 69 |
+
|
| 70 |
+
# Encode sentences
|
| 71 |
+
sentences = [
|
| 72 |
+
"How do I reset my password?",
|
| 73 |
+
"What is the process for password recovery?",
|
| 74 |
+
"I forgot my login credentials"
|
| 75 |
+
]
|
| 76 |
+
|
| 77 |
+
embeddings = model.encode(sentences)
|
| 78 |
+
print(embeddings.shape) # (3, 384)
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
### Similarity Search
|
| 82 |
|
|
|
|
| 83 |
```python
|
| 84 |
+
from sentence_transformers import SentenceTransformer, util
|
| 85 |
|
| 86 |
+
model = SentenceTransformer('DeepXR/Helion-V1-embeddings')
|
|
|
|
|
|
|
| 87 |
|
| 88 |
+
# Encode query and documents
|
| 89 |
+
query = "How to train a machine learning model?"
|
| 90 |
+
documents = [
|
| 91 |
+
"Machine learning training requires data preprocessing",
|
| 92 |
+
"The best way to cook pasta is boiling water",
|
| 93 |
+
"Neural networks need proper hyperparameter tuning"
|
| 94 |
]
|
| 95 |
|
| 96 |
+
query_embedding = model.encode(query)
|
| 97 |
+
doc_embeddings = model.encode(documents)
|
| 98 |
+
|
| 99 |
+
# Calculate similarity
|
| 100 |
+
similarities = util.cos_sim(query_embedding, doc_embeddings)
|
| 101 |
+
print(similarities)
|
| 102 |
```
|
| 103 |
|
| 104 |
+
### Integration with FAISS
|
| 105 |
+
|
| 106 |
+
```python
|
| 107 |
+
from sentence_transformers import SentenceTransformer
|
| 108 |
+
import faiss
|
| 109 |
+
import numpy as np
|
| 110 |
+
|
| 111 |
+
model = SentenceTransformer('DeepXR/Helion-V1-embeddings')
|
| 112 |
+
|
| 113 |
+
# Create embeddings
|
| 114 |
+
documents = ["doc1", "doc2", "doc3"]
|
| 115 |
+
embeddings = model.encode(documents)
|
| 116 |
+
|
| 117 |
+
# Create FAISS index
|
| 118 |
+
dimension = embeddings.shape[1]
|
| 119 |
+
index = faiss.IndexFlatL2(dimension)
|
| 120 |
+
index.add(embeddings.astype('float32'))
|
| 121 |
+
|
| 122 |
+
# Search
|
| 123 |
+
query_embedding = model.encode(["search query"])
|
| 124 |
+
distances, indices = index.search(query_embedding.astype('float32'), k=3)
|
| 125 |
+
```
|
| 126 |
+
|
| 127 |
+
## Performance
|
| 128 |
+
|
| 129 |
+
### Benchmark Results
|
| 130 |
+
|
| 131 |
+
| Task | Score | Notes |
|
| 132 |
+
|------|-------|-------|
|
| 133 |
+
| STS Benchmark | ~0.78 | Semantic Textual Similarity |
|
| 134 |
+
| Retrieval (BEIR) | ~0.42 | Average across datasets |
|
| 135 |
+
| Speed (CPU) | ~2000 sentences/sec | Batch size 32 |
|
| 136 |
+
| Speed (GPU) | ~15000 sentences/sec | Batch size 128 |
|
| 137 |
+
|
| 138 |
+
*Note: These are approximate values. Actual performance may vary.*
|
| 139 |
+
|
| 140 |
## Training Details
|
| 141 |
|
| 142 |
### Training Data
|
| 143 |
|
| 144 |
+
The model was fine-tuned on:
|
| 145 |
+
- Question-answer pairs
|
| 146 |
+
- Semantic similarity datasets
|
| 147 |
+
- Document-query pairs
|
| 148 |
+
- Paraphrase detection examples
|
| 149 |
|
| 150 |
### Training Procedure
|
| 151 |
|
| 152 |
+
- **Base Model:** sentence-transformers/all-MiniLM-L6-v2
|
| 153 |
+
- **Training Method:** Contrastive learning with cosine similarity
|
| 154 |
+
- **Loss Function:** MultipleNegativesRankingLoss
|
| 155 |
+
- **Batch Size:** 64
|
| 156 |
+
- **Epochs:** 3
|
| 157 |
+
- **Pooling:** Mean pooling
|
| 158 |
+
|
| 159 |
+
## Technical Specifications
|
| 160 |
+
|
| 161 |
+
### Model Architecture
|
| 162 |
+
- **Type:** Transformer-based encoder
|
| 163 |
+
- **Layers:** 6
|
| 164 |
+
- **Hidden Size:** 384
|
| 165 |
+
- **Attention Heads:** 12
|
| 166 |
+
- **Parameters:** ~22.7M
|
| 167 |
+
- **Pooling Strategy:** Mean pooling
|
| 168 |
+
|
| 169 |
+
### Input Format
|
| 170 |
+
- **Max Length:** 256 tokens
|
| 171 |
+
- **Tokenizer:** WordPiece
|
| 172 |
+
- **Normalization:** Applied automatically
|
| 173 |
+
|
| 174 |
+
### Output Format
|
| 175 |
+
- **Embedding Dimension:** 384
|
| 176 |
+
- **Dtype:** float32
|
| 177 |
+
- **Normalization:** L2 normalized (optional)
|
| 178 |
|
| 179 |
+
## Limitations
|
| 180 |
|
| 181 |
+
- **Sequence Length:** Limited to 256 tokens (longer texts are truncated)
|
| 182 |
+
- **Language:** Primarily optimized for English
|
| 183 |
+
- **Domain:** General-purpose, may need fine-tuning for specialized domains
|
| 184 |
+
- **Context:** Does not maintain conversation context across multiple inputs
|
| 185 |
+
- **Model Size:** Smaller than state-of-the-art models, trading some accuracy for speed
|
| 186 |
+
|
| 187 |
+
## Use Cases
|
| 188 |
+
|
| 189 |
+
### ✅ Good For:
|
| 190 |
+
- Semantic search in document collections
|
| 191 |
+
- Finding similar questions/answers
|
| 192 |
+
- Content recommendation
|
| 193 |
+
- Duplicate detection
|
| 194 |
+
- Clustering similar documents
|
| 195 |
+
- Quick similarity comparisons
|
| 196 |
+
|
| 197 |
+
### ❌ Not Suitable For:
|
| 198 |
+
- Long document encoding (>256 tokens)
|
| 199 |
+
- Real-time generation tasks
|
| 200 |
+
- Multilingual applications (without fine-tuning)
|
| 201 |
+
- Highly specialized domains without adaptation
|
| 202 |
+
- Tasks requiring deep reasoning
|
| 203 |
+
|
| 204 |
+
## Comparison with Other Models
|
| 205 |
+
|
| 206 |
+
| Model | Dim | Speed | Accuracy | Size |
|
| 207 |
+
|-------|-----|-------|----------|------|
|
| 208 |
+
| Helion-V1-Embeddings | 384 | Fast | Good | 80MB |
|
| 209 |
+
| all-MiniLM-L6-v2 | 384 | Fast | Good | 80MB |
|
| 210 |
+
| all-mpnet-base-v2 | 768 | Medium | Better | 420MB |
|
| 211 |
+
| text-embedding-ada-002 | 1536 | API | Best | API |
|
| 212 |
|
| 213 |
+
## Ethical Considerations
|
| 214 |
|
| 215 |
+
- **Bias:** May reflect biases present in training data
|
| 216 |
+
- **Privacy:** Do not embed sensitive personal information
|
| 217 |
+
- **Fairness:** Performance may vary across different text types
|
| 218 |
+
- **Use Responsibly:** Consider implications of similarity matching
|
| 219 |
|
| 220 |
+
## Integration Examples
|
|
|
|
|
|
|
|
|
|
| 221 |
|
| 222 |
+
### LangChain Integration
|
| 223 |
+
|
| 224 |
+
```python
|
| 225 |
+
from langchain.embeddings import HuggingFaceEmbeddings
|
| 226 |
|
| 227 |
+
embeddings = HuggingFaceEmbeddings(
|
| 228 |
+
model_name="DeepXR/Helion-V1-embeddings"
|
| 229 |
+
)
|
| 230 |
+
|
| 231 |
+
text = "This is a sample document"
|
| 232 |
+
embedding = embeddings.embed_query(text)
|
| 233 |
+
```
|
| 234 |
+
|
| 235 |
+
### LlamaIndex Integration
|
| 236 |
+
|
| 237 |
+
```python
|
| 238 |
+
from llama_index.embeddings import HuggingFaceEmbedding
|
| 239 |
+
|
| 240 |
+
embed_model = HuggingFaceEmbedding(
|
| 241 |
+
model_name="DeepXR/Helion-V1-embeddings"
|
| 242 |
+
)
|
| 243 |
+
|
| 244 |
+
embeddings = embed_model.get_text_embedding("Hello world")
|
| 245 |
+
```
|
| 246 |
|
| 247 |
## Citation
|
| 248 |
+
|
| 249 |
```bibtex
|
| 250 |
@misc{helion-v1-embeddings,
|
| 251 |
author = {DeepXR},
|
| 252 |
+
title = {Helion-V1-Embeddings: Lightweight Text Embedding Model},
|
| 253 |
+
year = {2024},
|
| 254 |
publisher = {HuggingFace},
|
| 255 |
url = {https://huggingface.co/DeepXR/Helion-V1-embeddings}
|
| 256 |
}
|
| 257 |
```
|
| 258 |
|
| 259 |
+
## Model Card Authors
|
| 260 |
+
|
| 261 |
+
DeepXR Team
|
| 262 |
+
|
| 263 |
## Contact
|
| 264 |
|
| 265 |
+
- Repository: https://huggingface.co/DeepXR/Helion-V1-embeddings
|
| 266 |
+
- Issues: https://huggingface.co/DeepXR/Helion-V1-embeddings/discussions
|