Views
No views yet
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'NewModel'})
(1): Pooling({'embedding_dimension': 768, 'pooling_mode': 'cls', 'include_prompt': True})
(2): Normalize({})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("IoannisKat1/gte-multilingual-base-matryoshka")
5# Run inference
6queries = [
7 'Ποιες είναι οι δύο τύποι τροφοδοσίας που αναφέρονται;',
8]
9documents = [
10 '. Ελεγκτές μεταβλητών στροφών και σχεδίαση σειριακού ελεγκτή με εσωτερικό βρόχο ρεύματος: ΑΜ διπλής τροφοδοσίας, ΑΜ ή ΣΜ με διασύνδεση συνεχούς ρεύματος, Γεννήτρια ΑΜ με ηλεκτρονικά μεταβαλλόμενη αντίσταση ρότορα. Έλεγχος πραγματικής και άεργου ισχύος. Έλεγχος βήματος πτερυγίου. Περιβαλλοντικές επιπτώσεις από την εγκατάσταση αιολικών συστημάτων και λοιπών ΑΠΕ. Σύνδεση με το δίκτυο',
11 '. Τα υποχρεωτικά είναι συγκεκριμένα βασικά μαθήματα της επιστήμης του Ηλεκτρολόγου Μηχανικού και Μηχανικού Υπολογιστών, τα οποία πρέπει να παρακολουθήσει και εξεταστεί επιτυχώς κάθε φοιτητής. Τα κατ’ επιλογήν υποχρεωτικά είναι μαθήματα εμβάθυνσης σε διάφορους ειδικούς τομείς',
12 'Η σελίδα παρουσιάζει τους Τομείς του Τμήματος Ηλεκτρολόγων Μηχανικών και Τεχνολογίας Υπολογιστών: Τηλεπικοινωνιών και Τεχνολογίας Πληροφορίας (Τ&ΤΠ), Συστημάτων Ηλεκτρικής Ενέργειας (ΣΗΕ), Ηλεκτρονικής και Υπολογιστών (Η&Υ) και Συστήματα και Αυτόματου Ελέγχου (Σ&ΑΕ)',
13]
14query_embeddings = model.encode_query(queries)
15document_embeddings = model.encode_document(documents)
16print(query_embeddings.shape, document_embeddings.shape)
17# [1, 768] [3, 768]
18
19# Get the similarity scores for the embeddings
20similarities = model.similarity(query_embeddings, document_embeddings)
21print(similarities)
22# tensor([[0.3604, 0.1620, 0.0892]])dim_768InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 768
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.5095 |
| cosine_accuracy@3 | 0.5411 |
| cosine_accuracy@5 | 0.6253 |
| cosine_accuracy@10 | 0.7032 |
| cosine_precision@1 | 0.5095 |
| cosine_precision@3 | 0.5158 |
| cosine_precision@5 | 0.4143 |
| cosine_precision@10 | 0.2463 |
| cosine_recall@1 | 0.1453 |
| cosine_recall@3 | 0.4319 |
| cosine_recall@5 | 0.5709 |
| cosine_recall@10 | 0.6804 |
| cosine_ndcg@10 | 0.6009 |
| cosine_mrr@10 | 0.5506 |
| cosine_map@100 | 0.597 |
dim_512InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 512
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.4989 |
| cosine_accuracy@3 | 0.52 |
| cosine_accuracy@5 | 0.6126 |
| cosine_accuracy@10 | 0.6926 |
| cosine_precision@1 | 0.4989 |
| cosine_precision@3 | 0.4982 |
| cosine_precision@5 | 0.4013 |
| cosine_precision@10 | 0.2444 |
| cosine_recall@1 | 0.1446 |
| cosine_recall@3 | 0.4189 |
| cosine_recall@5 | 0.5504 |
| cosine_recall@10 | 0.6714 |
| cosine_ndcg@10 | 0.5908 |
| cosine_mrr@10 | 0.5379 |
| cosine_map@100 | 0.5857 |
dim_256InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 256
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.4926 |
| cosine_accuracy@3 | 0.5116 |
| cosine_accuracy@5 | 0.6021 |
| cosine_accuracy@10 | 0.6779 |
| cosine_precision@1 | 0.4926 |
| cosine_precision@3 | 0.4912 |
| cosine_precision@5 | 0.3933 |
| cosine_precision@10 | 0.2383 |
| cosine_recall@1 | 0.1433 |
| cosine_recall@3 | 0.413 |
| cosine_recall@5 | 0.5409 |
| cosine_recall@10 | 0.6595 |
| cosine_ndcg@10 | 0.5805 |
| cosine_mrr@10 | 0.5301 |
| cosine_map@100 | 0.5747 |
dim_128InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 128
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.4463 |
| cosine_accuracy@3 | 0.4674 |
| cosine_accuracy@5 | 0.5495 |
| cosine_accuracy@10 | 0.6253 |
| cosine_precision@1 | 0.4463 |
| cosine_precision@3 | 0.4428 |
| cosine_precision@5 | 0.3575 |
| cosine_precision@10 | 0.2173 |
| cosine_recall@1 | 0.1305 |
| cosine_recall@3 | 0.3747 |
| cosine_recall@5 | 0.496 |
| cosine_recall@10 | 0.6026 |
| cosine_ndcg@10 | 0.5285 |
| cosine_mrr@10 | 0.4817 |
| cosine_map@100 | 0.5267 |
dim_64InformationRetrievalEvaluator with these parameters:
1{
2 "truncate_dim": 64
3}| Metric | Value |
|---|---|
| cosine_accuracy@1 | 0.3958 |
| cosine_accuracy@3 | 0.4126 |
| cosine_accuracy@5 | 0.4884 |
| cosine_accuracy@10 | 0.5474 |
| cosine_precision@1 | 0.3958 |
| cosine_precision@3 | 0.3916 |
| cosine_precision@5 | 0.3166 |
| cosine_precision@10 | 0.1905 |
| cosine_recall@1 | 0.1149 |
| cosine_recall@3 | 0.3326 |
| cosine_recall@5 | 0.4402 |
| cosine_recall@10 | 0.5326 |
| cosine_ndcg@10 | 0.4668 |
| cosine_mrr@10 | 0.4261 |
| cosine_map@100 | 0.4693 |
anchor and positive| anchor | positive | |
|---|---|---|
| type | string | string |
| modality | text | text |
| details |
|
|
| anchor | positive |
|---|---|
Πόσο διαρκεί το προπτυχιακό πρόγραμμα σπουδών; | . Το προπτυχιακό πρόγραμμα σπουδών έχει διάρκεια δέκα διδακτικών εξαμήνων και οδηγεί στην απονομή Διπλώματος Μηχανικού, το οποίο αναγνωρίζεται ως Integrated Master με πλήρη επαγγελματικά δικαιώματα |
Ποιες είναι οι αλγόριθμοι τοπικής αναζήτησης Ι; | . Επίλυση προβλημάτων με αναζήτηση: Χώροι καταστάσεων, δέντρα αναζήτησης, μέθοδοι αναζήτησης χωρίς πληροφόρηση (depth-first, breadth-first), αναζήτηση με μερική πληροφόρηση. 3. Πληροφορημένη αναζήτηση και εξερεύνηση: Αλγόριθμοι Best First και Α*. 4. Αλγόριθμοι τοπικής αναζήτησης Ι: Hill climbing, simulated annealing. 5. Αλγόριθμοι τοπικής αναζήτησης ΙΙ: Γενετικοί αλγόριθμοι. 6 |
Ποιες είναι οι δύο βασικές ικανότητες που σχετίζονται με την εφαρμογή στο εργαστήριο; | . • Η ανάπτυξη της κριτικής σκέψης, της ικανότητας λήψης αποφάσεων, της επιδίωξης της καινοτομίας, του εξωστρεφούς τρόπου σκέψης, του πνεύματος συνεργασίας και της ομαδικής προσπάθειας, και της ικανότητας προσαρμογής σε μεταβαλλόμενες συνθήκες. • Η πλήρης κατανόηση και η ικανότητα εφαρμογής του θεωρητικού υπόβαθρου στο εργαστήριο |
MatryoshkaLoss with these parameters:
1{
2 "loss": "MultipleNegativesRankingLoss",
3 "matryoshka_dims": [
4 768,
5 512,
6 256,
7 128,
8 64
9 ],
10 "matryoshka_weights": [
11 1,
12 1,
13 1,
14 1,
15 1
16 ],
17 "n_dims_per_step": -1
18}per_device_train_batch_size: 16gradient_accumulation_steps: 8learning_rate: 2e-05num_train_epochs: 10lr_scheduler_type: cosinewarmup_ratio: 0.1bf16: Truetf32: Trueload_best_model_at_end: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseprediction_loss_only: Trueper_device_train_batch_size: 16per_device_eval_batch_size: 8per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 8eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 2e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 10max_steps: -1lr_scheduler_type: cosinelr_scheduler_kwargs: Nonewarmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falsebf16: Truefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Truelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Trueignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthproject: huggingfacetrackio_space_id: trackioddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: noneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Trueprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss | dim_768_cosine_ndcg@10 | dim_512_cosine_ndcg@10 | dim_256_cosine_ndcg@10 | dim_128_cosine_ndcg@10 | dim_64_cosine_ndcg@10 |
|---|---|---|---|---|---|---|---|
| 0.2996 | 10 | 4.9665 | - | - | - | - | - |
| 0.5993 | 20 | 4.4986 | - | - | - | - | - |
| 0.8989 | 30 | 3.3306 | - | - | - | - | - |
| 1.0 | 34 | - | 0.5533 | 0.5562 | 0.5324 | 0.4876 | 0.4216 |
| 1.1798 | 40 | 2.5665 | - | - | - | - | - |
| 1.4794 | 50 | 2.1953 | - | - | - | - | - |
| 1.7790 | 60 | 2.1143 | - | - | - | - | - |
| 2.0 | 68 | - | 0.5933 | 0.5833 | 0.5585 | 0.5128 | 0.4431 |
| 2.0599 | 70 | 1.7159 | - | - | - | - | - |
| 2.3596 | 80 | 1.3878 | - | - | - | - | - |
| 2.6592 | 90 | 1.4126 | - | - | - | - | - |
| 2.9588 | 100 | 1.3782 | - | - | - | - | - |
| 3.0 | 102 | - | 0.5855 | 0.5795 | 0.5601 | 0.5127 | 0.4474 |
| 3.2397 | 110 | 1.1938 | - | - | - | - | - |
| 3.5393 | 120 | 1.0914 | - | - | - | - | - |
| 3.8390 | 130 | 1.0606 | - | - | - | - | - |
| 4.0 | 136 | - | 0.5942 | 0.5803 | 0.5624 | 0.5239 | 0.4519 |
| 4.1199 | 140 | 0.9771 | - | - | - | - | - |
| 4.4195 | 150 | 0.8633 | - | - | - | - | - |
| 4.7191 | 160 | 0.9322 | - | - | - | - | - |
| 5.0 | 170 | 0.8111 | 0.6041 | 0.5964 | 0.5709 | 0.5339 | 0.4518 |
| 5.2996 | 180 | 0.7574 | - | - | - | - | - |
| 5.5993 | 190 | 0.7694 | - | - | - | - | - |
| 5.8989 | 200 | 0.8429 | - | - | - | - | - |
| 6.0 | 204 | - | 0.5974 | 0.5954 | 0.5750 | 0.5310 | 0.4632 |
| 6.1798 | 210 | 0.8397 | - | - | - | - | - |
| 6.4794 | 220 | 0.7183 | - | - | - | - | - |
| 6.7790 | 230 | 0.7234 | - | - | - | - | - |
| 7.0 | 238 | - | 0.6030 | 0.5891 | 0.5768 | 0.5290 | 0.4658 |
| 7.0599 | 240 | 0.6865 | - | - | - | - | - |
| 7.3596 | 250 | 0.6614 | - | - | - | - | - |
| 7.6592 | 260 | 0.6584 | - | - | - | - | - |
| 7.9588 | 270 | 0.6603 | - | - | - | - | - |
| 8.0 | 272 | - | 0.6033 | 0.5921 | 0.5760 | 0.5271 | 0.4697 |
| 8.2397 | 280 | 0.65 | - | - | - | - | - |
| 8.5393 | 290 | 0.581 | - | - | - | - | - |
| 8.8390 | 300 | 0.571 | - | - | - | - | - |
| 9.0 | 306 | - | 0.6027 | 0.5904 | 0.5786 | 0.5280 | 0.4653 |
| 9.1199 | 310 | 0.5424 | - | - | - | - | - |
| 9.4195 | 320 | 0.632 | - | - | - | - | - |
| 9.7191 | 330 | 0.5892 | - | - | - | - | - |
| 10.0 | 340 | 0.6056 | 0.6009 | 0.5908 | 0.5805 | 0.5285 | 0.4668 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{kusupati2024matryoshka,
2 title={Matryoshka Representation Learning},
3 author={Aditya Kusupati and Gantavya Bhatt and Aniket Rege and Matthew Wallingford and Aditya Sinha and Vivek Ramanujan and William Howard-Snyder and Kaifeng Chen and Sham Kakade and Prateek Jain and Ali Farhadi},
4 year={2024},
5 eprint={2205.13147},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG}
8}1@misc{oord2019representationlearningcontrastivepredictive,
2 title={Representation Learning with Contrastive Predictive Coding},
3 author={Aaron van den Oord and Yazhe Li and Oriol Vinyals},
4 year={2019},
5 eprint={1807.03748},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG},
8 url={https://arxiv.org/abs/1807.03748},
9}