Downloads · 30 days
100
21% of all-time downloads
ImranzamanML/German_Semantic_V3b_Optimised
German_Semantic_V3b_Optimised is a sentence similarity model from ImranzamanML. Use it when you need a score for how close two texts are. It is set up for sentence-transformers. The card lists the license as apache-2.0.
The successors of GermanSemanticSTSV2 are here and come with loads of cool new features! While GermanSemanticV3 is really knowledge-heavy, V3b is more focused on performance. Feel free to provide feedback on the model…
Downloads · 30 days
100
21% of all-time downloads
All-time downloads
478
Public
Parameters
344M
1.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
The successors of German_Semantic_STS_V2 are here and come with loads of cool new features! While German_Semantic_V3 is really knowledge-heavy, V3b is more focused on performance. Feel free to provide feedback on the model and what you would like to see next.
Note: To run this model properly, see "Usage".
This model has some build-in functionality that is rather hidden. To profit from it, use this code:
from sentence_transformers import SentenceTransformer
matryoshka_dim = 1024 # How big your embeddings should be, choose from: 64, 128, 256, 512, 768, 1024
model = SentenceTransformer("aari1995/German_Semantic_V3", trust_remote_code=True, truncate_dim=matryoshka_dim)
# model.truncate_dim = 64 # truncation dimensions can also be changed after loading
# model.max_seq_length = 512 #optionally, set your maximum sequence length lower if your hardware is limited
# Run inference
sentences = [
'Eine Flagge weht.',
'Die Flagge bewegte sich in der Luft.',
'Zwei Personen beobachten das Wasser.',
]
# For FP16 embeddings (half space, no quality loss)
embeddings = model.encode(sentences, convert_to_tensor=True).half()
# For FP32 embeddings (takes more space)
# embeddings = model.encode(sentences)
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
Q: Is this Model better than V2?
A: In terms of flexibility, this model is better. Performance wise, in most of the experiments this model is also better.
Q: What is the difference between V3 and V3b?
A: V3 is slightly worse on benchmarks, while V3b has a knowledge cutoff by 2020, so it really depends on your use-case what model to use.
If you want peak performance and do not worry too much about recent developments, take this one (V3b).
If you are fine with sacrificing a few points on benchmarks and want the model to know what happened from 2020 on (elections, covid, other cultural events etc.), I'd suggest you use German_Semantic_V3.
Another noticable difference is that V3 has a broader cosine_similarity spectrum, reaching from -1 to 1 (but mostly, the least is over -0.2). On the other side, V3b is more aligned with V2 and the similarity spectrum is around 0 to 1. Also, V3 uses cls_pooling while V3b uses mean_pooling.
Q: How does the model perform vs. multilingual models?
A: There are really great multilingual models that will be very useful for many use-cases. This model shines with its cultural knowledge and knowledge about German people and behaviour.
Q: What is the trade-off when reducing the embedding size?
A: Broadly speaking, when going from 1024 to 512 dimensions, there is very little trade-off (1 percent). When going down to 64 dimensions, you may face a decrease of up to 3 percent.
Storage comparison:

Benchmarks: soon.
German_Semantic_V3_Instruct: Guiding your embeddings towards self-selected aspects. - planned: 2024.
Idea, Training and Implementation by Aaron Chibb