paraphrase-multilingual-MiniLM-L12-hu-v2
This is a sentence-transformers model finetuned from sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 on the train dataset. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.
Model Details
Model Description
- Model Type: Sentence Transformer
- Base model: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
- Maximum Sequence Length: 128 tokens
- Output Dimensionality: 384 tokens
- Similarity Function: Cosine Similarity
- Training Dataset:
- train
- Language: hu
- License: apache-2.0
Model Sources
- Documentation: Sentence Transformers Documentation
- Repository: Sentence Transformers on GitHub
- Hugging Face: Sentence Transformers on Hugging Face
Full Model Architecture
SentenceTransformer(
(0): Transformer({'max_seq_length': 128, 'do_lower_case': False}) with Transformer model: BertModel
(1): Pooling({'word_embedding_dimension': 384, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)
Usage
Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
pip install -U sentence-transformers
Then you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("karsar/paraphrase-multilingual-MiniLM-L12-hu-v2")
# Run inference
sentences = [
'Az emberek alszanak.',
'Egy apa és a fia ölelgeti alvás közben.',
'Egy csoport ember ül egy nyitott, térszerű területen, mögötte nagy bokrok és egy sor viktoriánus stílusú épület, melyek közül sokat a kép jobb oldalán lévő erős elmosódás tesz kivehetetlenné.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]
Evaluation
Metrics
Triplet
- Dataset:
all-nli-dev
- Evaluated with
TripletEvaluator
Metric | Value |
---|---|
cosine_accuracy | 0.9918 |
dot_accuracy | 0.0102 |
manhattan_accuracy | 0.99 |
euclidean_accuracy | 0.99 |
max_accuracy | 0.9918 |
Triplet
- Dataset:
all-nli-test
- Evaluated with
TripletEvaluator
Metric | Value |
---|---|
cosine_accuracy | 0.9938 |
dot_accuracy | 0.008 |
manhattan_accuracy | 0.9929 |
euclidean_accuracy | 0.9924 |
max_accuracy | 0.9938 |
Training Details
Training Dataset
train
- Dataset: train
- Size: 1,044,013 training samples
- Columns:
anchor
,positive
, andnegative
- Approximate statistics based on the first 1000 samples:
anchor positive negative type string string string details - min: 7 tokens
- mean: 11.73 tokens
- max: 56 tokens
- min: 6 tokens
- mean: 15.24 tokens
- max: 47 tokens
- min: 7 tokens
- mean: 16.07 tokens
- max: 53 tokens
- Samples:
anchor positive negative Egy lóháton ülő ember átugrik egy lerombolt repülőgép felett.
Egy ember a szabadban, lóháton.
Egy ember egy étteremben van, és omlettet rendel.
Gyerekek mosolyogva és integetett a kamera
Gyermekek vannak jelen
A gyerekek homlokot rántanak
Egy fiú ugrál a gördeszkát a közepén egy piros híd.
A fiú gördeszkás trükköt csinál.
A fiú korcsolyázik a járdán.
- Loss:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
Evaluation Dataset
train
- Dataset: train
- Size: 5,000 evaluation samples
- Columns:
anchor
,positive
, andnegative
- Approximate statistics based on the first 1000 samples:
anchor positive negative type string string string details - min: 7 tokens
- mean: 11.73 tokens
- max: 56 tokens
- min: 6 tokens
- mean: 15.24 tokens
- max: 47 tokens
- min: 7 tokens
- mean: 16.07 tokens
- max: 53 tokens
- Samples:
anchor positive negative Egy lóháton ülő ember átugrik egy lerombolt repülőgép felett.
Egy ember a szabadban, lóháton.
Egy ember egy étteremben van, és omlettet rendel.
Gyerekek mosolyogva és integetett a kamera
Gyermekek vannak jelen
A gyerekek homlokot rántanak
Egy fiú ugrál a gördeszkát a közepén egy piros híd.
A fiú gördeszkás trükköt csinál.
A fiú korcsolyázik a járdán.
- Loss:
MultipleNegativesRankingLoss
with these parameters:{ "scale": 20.0, "similarity_fct": "cos_sim" }
Training Hyperparameters
Non-Default Hyperparameters
eval_strategy
: stepsper_device_train_batch_size
: 128per_device_eval_batch_size
: 128num_train_epochs
: 1warmup_ratio
: 0.1bf16
: Truebatch_sampler
: no_duplicates
Framework Versions
- Python: 3.11.8
- Sentence Transformers: 3.1.1
- Transformers: 4.44.0
- PyTorch: 2.3.0.post101
- Accelerate: 0.33.0
- Datasets: 3.0.2
- Tokenizers: 0.19.0
Citation
BibTeX
Sentence Transformers
@inproceedings{reimers-2019-sentence-bert,
title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
author = "Reimers, Nils and Gurevych, Iryna",
booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
month = "11",
year = "2019",
publisher = "Association for Computational Linguistics",
url = "https://arxiv.org/abs/1908.10084",
}
MultipleNegativesRankingLoss
@misc{henderson2017efficient,
title={Efficient Natural Language Response Suggestion for Smart Reply},
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
year={2017},
eprint={1705.00652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
- Downloads last month
- 167
Evaluation results
- main_score on MTEB BelebeleRetrieval (hun_Latn-hun_Latn)test set self-reported80.204
- map_at_1 on MTEB BelebeleRetrieval (hun_Latn-hun_Latn)test set self-reported69.111
- map_at_10 on MTEB BelebeleRetrieval (hun_Latn-hun_Latn)test set self-reported76.773
- map_at_100 on MTEB BelebeleRetrieval (hun_Latn-hun_Latn)test set self-reported77.169
- map_at_1000 on MTEB BelebeleRetrieval (hun_Latn-hun_Latn)test set self-reported77.173
- map_at_20 on MTEB BelebeleRetrieval (hun_Latn-hun_Latn)test set self-reported77.033
- map_at_3 on MTEB BelebeleRetrieval (hun_Latn-hun_Latn)test set self-reported75.333
- map_at_5 on MTEB BelebeleRetrieval (hun_Latn-hun_Latn)test set self-reported76.194
- mrr_at_1 on MTEB BelebeleRetrieval (hun_Latn-hun_Latn)test set self-reported69.111
- mrr_at_10 on MTEB BelebeleRetrieval (hun_Latn-hun_Latn)test set self-reported76.773