ThanhLe0125/e5-math-ebd-01
SentenceTransformer based on intfloat/multilingual-e5-base
This is a sentence-transformers model finetuned from intfloat/multilingual-e5-base. It maps sentences & paragraphs to a 768-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: intfloat/multilingual-e5-base <!-- at revision 835193815a3936a24a0ee7dc9e3d48c1fbb19c55 -->
- Maximum Sequence Length: 256 tokens
- Output Dimensionality: 768 dimensions
- Similarity Function: Cosine Similarity <!-- - Training Dataset: Unknown --> <!-- - Language: Unknown --> <!-- - License: Unknown -->
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': 256, 'do_lower_case': False}) with Transformer model: XLMRobertaModel
(1): Pooling({'word_embedding_dimension': 768, '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})
(2): Normalize()
)Usage
Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
pip install -U sentence-transformersThen you can load this model and run inference.
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("ThanhLe0125/e5-math-ebd-01")
# Run inference
sentences = [
"query: Ý nghĩa của việc tìm nghiệm của phương trình f'(x) = 0?",
"passage: # Phương pháp tìm cực trị của hàm số\n\n## Quy trình tìm cực trị\n**Bước 1:** Tìm tập xác định của hàm số\n**Bước 2:** Tính đạo hàm $f'(x)$\n**Bước 3:** Tìm nghiệm của phương trình $f'(x) = 0$ và các điểm mà $f'(x)$ không xác định\n**Bước 4:** Lập bảng xét dấu $f'(x)$\n**Bước 5:** Kết luận về cực trị\n\n## Ví dụ minh họa\nTìm cực trị của hàm số $f(x) = x^4 - 2x^2 + 1$.\n\n**Lời giải:**\nTập xác định: $D = \\mathbb{R}$\n$f'(x) = 4x^3 - 4x = 4x(x^2 - 1) = 4x(x-1)(x+1)$\n$f'(x) = 0 \\Leftrightarrow x = -1, x = 0, x = 1$\n\nBảng xét dấu:\n- $x \\in (-\\infty; -1)$: $f'(x) < 0$\n- $x \\in (-1; 0)$: $f'(x) > 0$ \n- $x \\in (0; 1)$: $f'(x) < 0$\n- $x \\in (1; +\\infty)$: $f'(x) > 0$\n\n**Kết luận:**\n- $x = -1$: cực tiểu, $f(-1) = 0$\n- $x = 0$: cực đại, $f(0) = 1$\n- $x = 1$: cực tiểu, $f(1) = 0$",
'passage: # Tổ hợp\n\n## Định nghĩa\n**Tổ hợp chập $k$ của $n$ phần tử** là cách chọn $k$ phần tử từ $n$ phần tử mà không quan tâm đến thứ tự.\n\n**Ký hiệu:** $C_n^k$ hoặc $\\binom{n}{k}$\n\n**Điều kiện:** $0 \\leq k \\leq n$\n\n## Công thức\n$$C_n^k = \\frac{A_n^k}{k!} = \\frac{n!}{k!(n-k)!}$$\n\n**Công thức Pascal:** $C_n^k = C_{n-1}^{k-1} + C_{n-1}^k$\n\n## Tính chất cơ bản\n1. $C_n^0 = C_n^n = 1$\n2. $C_n^k = C_n^{n-k}$\n3. $C_n^1 = n$\n4. $C_n^2 = \\frac{n(n-1)}{2}$\n\n## Ví dụ tính toán\n**Ví dụ 1:** Từ 10 học sinh, chọn 3 học sinh tham gia đội tuyển. Có bao nhiêu cách?\n\n**Lời giải:** $C_{10}^3 = \\frac{10!}{3! \\times 7!} = \\frac{10 \\times 9 \\times 8}{3 \\times 2 \\times 1} = 120$ cách.\n\n**Ví dụ 2:** Trong một lớp có 15 nam và 10 nữ. Chọn 5 người sao cho có đúng 3 nam và 2 nữ.\n\n**Lời giải:** \n- Chọn 3 nam từ 15 nam: $C_{15}^3 = 455$ cách\n- Chọn 2 nữ từ 10 nữ: $C_{10}^2 = 45$ cách\n- Tổng cộng: $455 \\times 45 = 20,475$ cách\n\n## Nhị thức Newton\n$$(a + b)^n = \\sum_{k=0}^{n} C_n^k a^{n-k} b^k$$\n\n**Ví dụ:** $(x + 2)^4 = C_4^0 x^4 + C_4^1 x^3 \\cdot 2 + C_4^2 x^2 \\cdot 2^2 + C_4^3 x \\cdot 2^3 + C_4^4 \\cdot 2^4$\n$= x^4 + 8x^3 + 24x^2 + 32x + 16$\n\n## Phân biệt chỉnh hợp và tổ hợp\n- **Chỉnh hợp:** Quan tâm thứ tự (Ví dụ: Chọn và xếp hạng)\n- **Tổ hợp:** Không quan tâm thứ tự (Ví dụ: Chọn thành viên nhóm)\n\n**Mối quan hệ:** $A_n^k = k! \\times C_n^k$',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]<!--
Direct Usage (Transformers)
<details><summary>Click to see the direct usage in Transformers</summary>
</details> -->
<!--
Downstream Usage (Sentence Transformers)
You can finetune this model on your own dataset.
<details><summary>Click to expand</summary>
</details> -->
<!--
Out-of-Scope Use
List how the model may foreseeably be misused and address what users ought not to do with the model. -->
Evaluation
Metrics
Binary Classification
- Dataset:
ranking_evaluator - Evaluated with <code>BinaryClassificationEvaluator</code>
<!--
Bias, Risks and Limitations
What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->
<!--
Recommendations
What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->
Training Details
Training Dataset
Unnamed Dataset
- Size: 1,924 training samples
- Columns: <code>sentence0</code>, <code>sentence1</code>, and <code>sentence_2</code>
- Approximate statistics based on the first 1000 samples: | | sentence0 | sentence1 | sentence_2 | |:--------|:-----------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------| | type | string | string | string | | details | <ul><li>min: 10 tokens</li><li>mean: 24.47 tokens</li><li>max: 56 tokens</li></ul> | <ul><li>min: 228 tokens</li><li>mean: 254.6 tokens</li><li>max: 256 tokens</li></ul> | <ul><li>min: 228 tokens</li><li>mean: 254.43 tokens</li><li>max: 256 tokens</li></ul> |
- Samples: | sentence0 | sentence1 | sentence2 | |:-------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | <code>query: Giải thích ý nghĩa của ký hiệu C(n, k) và A(n, k) trong toán tổ hợp.</code> | <code>passage: # Bài toán tổ hợp - chỉnh hợp thực tế<br><br>## Dạng bài thường gặp<br>1. **Sắp xếp người ngồi**<br>2. **Chọn đội tuyển, ủy ban**<br>3. **Phân chia nhóm**<br>4. **Xếp lịch, phân công**<br>5. **Mật khẩu, biển số xe**<br><br>## Ví dụ tổng hợp<br>**Ví dụ 1:** Một bàn dài có 10 ghế. Có 6 nam và 4 nữ. Hỏi có bao nhiêu cách xếp sao cho:<br>a) Các nữ ngồi cạnh nhau<br>b) Nam và nữ ngồi xen kẽ<br><br>**Lời giải:**<br>a) Coi 4 nữ như 1 khối, ta có 7 đối tượng (6 nam + 1 khối nữ)<br> - Xếp 7 đối tượng: $7!$ cách<br> - Xếp 4 nữ trong khối: $4!$ cách<br> - Tổng: $7! \times 4! = 120,960$ cách<br><br>b) Vì có 6 nam và 4 nữ, xếp theo kiểu: N-Nam-N-Nam-...<br> - Xếp 6 nam: $6!$ cách<br> - Chọn 4 vị trí từ 7 vị trí giữa các nam: $C7^4$ cách<br> - Xếp 4 nữ vào 4 vị trí đã chọn: $4!$ cách<br> - Tổng: $6! \times C7^4 \times 4! = 1,209,600$ cách<br><br>**Ví dụ 2:** Chia 12 học sinh thành 3 nhóm có 4 người mỗi nhóm.<br><br>**Lời giải:**<br>- Chọn 4 người cho nhóm 1: $C{12}^4$<br>- Chọn 4 người cho nhóm 2 từ 8 người còn lại: $C8^4$ <br>- 4 người còn lại tự động vào nhóm 3...</code> | <code>passage: # Tiệm cận đứng của đồ thị hàm số<br><br>## Định nghĩa<br>Đường thẳng $x = a$ được gọi là **tiệm cận đứng** của đồ thị hàm số $y = f(x)$ nếu ít nhất một trong các điều kiện sau được thỏa mãn:<br>- $\lim{x \to a^+} f(x) = +\infty$ hoặc $\lim{x \to a^+} f(x) = -\infty$<br>- $\lim{x \to a^-} f(x) = +\infty$ hoặc $\lim{x \to a^-} f(x) = -\infty$<br><br>## Phương pháp tìm tiệm cận đứng<br>**Đối với hàm phân thức $f(x) = \frac{P(x)}{Q(x)}$:**<br>1. Tìm nghiệm của $Q(x) = 0$ mà không phải nghiệm của $P(x) = 0$<br>2. Với mỗi nghiệm $x = a$, tính giới hạn một phía<br>3. Nếu có giới hạn vô cực thì $x = a$ là tiệm cận đứng<br><br>## Ví dụ<br>Tìm tiệm cận đứng của $f(x) = \frac{x+1}{x^2-4}$.<br><br>**Lời giải:**<br>$x^2 - 4 = 0 \Leftrightarrow x = \pm 2$<br><br>Tại $x = 2$:<br>- $\lim{x \to 2^+} \frac{x+1}{x^2-4} = \lim{x \to 2^+} \frac{3}{(x-2)(x+2)} = +\infty$<br>- $\lim{x \to 2^-} \frac{x+1}{x^2-4} = -\infty$<br><br>Tại $x = -2$:<br>- $\lim{x \to (-2)^+} \frac{x+1}{x^2-4} = -\infty$ <br>- $\lim{x \to (-2)^-} \frac{x+1}{x^2-4} = +\infty$<br><br>*Kết luận:...</code> | | <code>query: Trong một hộp có 7 viên bi khác nhau. Lấy ngẫu nhiên ra 2 viên. Hỏi có bao nhiêu cách lấy?</code> | <code>passage: # Bài toán tổ hợp - chỉnh hợp thực tế<br><br>## Dạng bài thường gặp<br>1. Sắp xếp người ngồi<br>2. Chọn đội tuyển, ủy ban<br>3. Phân chia nhóm<br>4. Xếp lịch, phân công<br>5. Mật khẩu, biển số xe<br><br>## Ví dụ tổng hợp<br>Ví dụ 1: Một bàn dài có 10 ghế. Có 6 nam và 4 nữ. Hỏi có bao nhiêu cách xếp sao cho:<br>a) Các nữ ngồi cạnh nhau<br>b) Nam và nữ ngồi xen kẽ<br><br>Lời giải:<br>a) Coi 4 nữ như 1 khối, ta có 7 đối tượng (6 nam + 1 khối nữ)<br> - Xếp 7 đối tượng: $7!$ cách<br> - Xếp 4 nữ trong khối: $4!$ cách<br> - Tổng: $7! \times 4! = 120,960$ cách<br><br>b) Vì có 6 nam và 4 nữ, xếp theo kiểu: N-Nam-N-Nam-...<br> - Xếp 6 nam: $6!$ cách<br> - Chọn 4 vị trí từ 7 vị trí giữa các nam: $C7^4$ cách<br> - Xếp 4 nữ vào 4 vị trí đã chọn: $4!$ cách<br> - Tổng: $6! \times C7^4 \times 4! = 1,209,600$ cách<br><br>Ví dụ 2: Chia 12 học sinh thành 3 nhóm có 4 người mỗi nhóm.<br><br>Lời giải:<br>- Chọn 4 người cho nhóm 1: $C{12}^4$<br>- Chọn 4 người cho nhóm 2 từ 8 người còn lại: $C8^4$ <br>- 4 người còn lại tự động vào nhóm 3...</code> | <code>passage: # Tính toán phương sai và độ lệch chuẩn<br><br>## Ví dụ 1: Dữ liệu rời rạc<br>Điểm số: 6, 7, 8, 9, 10<br><br>Bước 1: Tính trung bình<br>$\bar{x} = \frac{6 + 7 + 8 + 9 + 10}{5} = 8$<br><br>Bước 2: Tính phương sai<br>| $xi$ | $xi - \bar{x}$ | $(xi - \bar{x})^2$ |<br>|-------|-----------------|---------------------|<br>| 6 | -2 | 4 |<br>| 7 | -1 | 1 |<br>| 8 | 0 | 0 |<br>| 9 | 1 | 1 |<br>| 10 | 2 | 4 |<br><br>$s^2 = \frac{4 + 1 + 0 + 1 + 4}{5} = 2$<br><br>**Bước 3:** Tính độ lệch chuẩn<br>$s = \sqrt{2} \approx 1.41$<br><br>## Ví dụ 2: Dữ liệu ghép nhóm<br>Chiều cao 40 học sinh:<br><br>| Lớp (cm) | Tần số | Giá trị đại diện |<br>|--------------|--------|------------------|<br>| [150; 155) | 4 | 152.5 |<br>| [155; 160) | 8 | 157.5 |<br>| [160; 165) | 16 | 162.5 |<br>| [165; 170) | 10 | 167.5 |<br>| [170; 175) | 2 ...</code> | | <code>query: So sánh sự khác biệt giữa khảo sát hàm phân thức bậc nhất trên bậc nhất với khảo sát hàm số bậc hai.</code> | <code>passage: # Khảo sát hàm phân thức bậc nhất trên bậc nhất: $f(x) = \frac{ax + b}{cx + d}$<br><br>## Điều kiện<br>$c \neq 0$ và $ad - bc \neq 0$<br><br>## Đặc điểm chung<br>- Tập xác định: $D = \mathbb{R} \setminus \{-\frac{d}{c}\}$<br>- Tiệm cận đứng: $x = -\frac{d}{c}$<br>- Tiệm cận ngang: $y = \frac{a}{c}$<br>- Hàm số đơn điệu trên mỗi khoảng xác định<br><br>## Tính đơn điệu<br>$f'(x) = \frac{ad - bc}{(cx + d)^2}$<br><br>- Nếu $ad - bc > 0$: hàm đồng biến trên mỗi khoảng xác định<br>- Nếu $ad - bc < 0$: hàm nghịch biến trên mỗi khoảng xác định<br><br>## Tâm đối xứng<br>Đồ thị có tâm đối xứng là giao điểm của hai tiệm cận: $I(-\frac{d}{c}; \frac{a}{c})$<br><br>## Ví dụ<br>Khảo sát $f(x) = \frac{2x + 1}{x - 1}$.<br><br>**Lời giải:**<br>- TXĐ: $D = \mathbb{R} \setminus \{1\}$<br>- $f'(x) = \frac{2(x-1) - (2x+1)}{(x-1)^2} = \frac{-3}{(x-1)^2} < 0$<br>- Hàm nghịch biến trên $(-\infty; 1)$ và $(1; +\infty)$<br>- Tiệm cận đứng: $x = 1$<br>- Tiệm cận ngang: $y = 2$<br>- Tâm đối xứng: $I(1; 2)$<br>- Giao trục tung: $(0; -1)$<br>- Giao trục hoành: $(-\frac{1}{2}; 0)$</code> | <code>passage: # Giá trị lớn nhất và nhỏ nhất của hàm số<br><br>## Định nghĩa<br>Cho hàm số $y = f(x)$ xác định trên tập $D$.<br><br>**Giá trị lớn nhất:** Số $M$ được gọi là giá trị lớn nhất của hàm số $f(x)$ trên $D$ nếu:<br>- $f(x) \leq M$ với mọi $x \in D$<br>- Tồn tại $x0 \in D$ sao cho $f(x0) = M$<br><br>**Giá trị nhỏ nhất:** Số $m$ được gọi là giá trị nhỏ nhất của hàm số $f(x)$ trên $D$ nếu:<br>- $f(x) \geq m$ với mọi $x \in D$ <br>- Tồn tại $x0 \in D$ sao cho $f(x_0) = m$<br><br>## Định lý Weierstrass<br>Nếu hàm số $f(x)$ liên tục trên đoạn $[a; b]$ thì $f(x)$ đạt giá trị lớn nhất và giá trị nhỏ nhất trên đoạn đó.<br><br>## Sự khác biệt với cực trị<br>- Cực trị: khái niệm địa phương (so sánh trong lân cận)<br>- Giá trị lớn nhất, nhỏ nhất: khái niệm toàn cục (so sánh trên toàn bộ tập xác định)</code> |
- Loss: <code>MultipleNegativesRankingLoss</code> with these parameters:
{
"scale": 20.0,
"similarity_fct": "cos_sim"
}Training Hyperparameters
Non-Default Hyperparameters
eval_strategy: stepsper_device_train_batch_size: 4per_device_eval_batch_size: 4num_train_epochs: 20multi_dataset_batch_sampler: round_robin
All Hyperparameters
<details><summary>Click to expand</summary>
overwrite_output_dir: Falsedo_predict: Falseeval_strategy: stepsprediction_loss_only: Trueper_device_train_batch_size: 4per_device_eval_batch_size: 4per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1num_train_epochs: 20max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.0warmup_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: Falseuse_ipex: Falsebf16: Falsefp16: Falsefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_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: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}tp_size: 0fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'splitbatches': False, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}deepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torchoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_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: Falsegradient_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: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: batch_samplermulti_dataset_batch_sampler: round_robin
</details>
Training Logs
Framework Versions
- Python: 3.11.11
- Sentence Transformers: 3.4.1
- Transformers: 4.51.3
- PyTorch: 2.6.0+cu124
- Accelerate: 1.5.2
- Datasets: 3.6.0
- Tokenizers: 0.21.1
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}
}<!--
Glossary
Clearly define terms in order to be accessible across audiences. -->
<!--
Model Card Authors
Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->
<!--
Model Card Contact
Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->
