Model Pipeline - Sentence transformers
This pipeline converts sentences into numbers that computers understand well. It helps find how similar sentences are or groups sentences by meaning.
Jump into concepts and practice - no test required
This pipeline converts sentences into numbers that computers understand well. It helps find how similar sentences are or groups sentences by meaning.
Loss
0.9 |*
0.8 | **
0.7 | **
0.6 | **
0.5 | **
0.4 | **
0.3 | **
+--------
1 2 3 4 5 Epochs
| Epoch | Loss ↓ | Accuracy ↑ | Observation |
|---|---|---|---|
| 1 | 0.85 | 0.50 | Model starts learning sentence meanings |
| 2 | 0.65 | 0.65 | Loss decreases, accuracy improves |
| 3 | 0.50 | 0.75 | Model better understands sentence similarity |
| 4 | 0.40 | 0.82 | Training converges with good accuracy |
| 5 | 0.35 | 0.85 | Final epoch with best performance |
from sentence_transformers import SentenceTransformer
model = SentenceTransformer('all-MiniLM-L6-v2')
sentence = 'Hello world'
embedding = model.encode(sentence)
print(type(embedding))from sentence_transformers import SentenceTransformer
model = SentenceTransformer('all-MiniLM-L6-v2')
sentences = ['Hello world', 'Hi there']
embeddings = model.encode(sentences)
print(embeddings.shape)