ThanhLe0125 / e5-math-ebd

huggingface.co
Total runs: 102
24-hour runs: 2
7-day runs: 7
30-day runs: 21
Model's Last Updated: July 06 2025
sentence-similarity

Introduction of e5-math-ebd

Model Details of e5-math-ebd

E5-Math-Vietnamese: MRR-Optimized with Base Model Comparison

Model Overview

Fine-tuned E5-base model optimized with MRR (Mean Reciprocal Rank) for exact chunk retrieval in Vietnamese mathematics. Includes comprehensive comparison with base model.

Performance Comparison
Training vs Test Performance
  • Best Validation MRR : 0.8388888888888888 (avg rank: 1.1920529801324504)
  • Test MRR : 0.8449820788530465 (avg rank: 1.183457051961824)
  • Training Epochs : 7
Fine-tuned vs Base Model Comparison
Metric Fine-tuned Base Model Improvement
MRR 0.8449820788530465 0.7593189964157707 +0.08566308243727583 (11.3%)
Avg Rank 1.183457051961824 1.316969553929667 Better by 0.13351250196784314 positions
Detailed Recall@k Comparison
Metric Fine-tuned Base Model Improvement
Recall@1 0.720 0.581 +0.140
Recall@2 0.925 0.860 +0.065
Recall@3 0.968 0.925 +0.043
Recall@4 1.000 0.978 +0.022
Recall@5 1.000 0.989 +0.011
Key Improvements from Fine-tuning

✅ MRR Boost : +0.08566308243727583 improvement in Mean Reciprocal Rank ✅ Ranking Quality : Correct chunks moved up by avg 0.13351250196784314 positions
✅ Hit Rate : Better success rates across all Recall@k metrics ✅ Vietnamese Math : Specialized for Vietnamese mathematical content ✅ Hierarchy : Maintains Correct > Related > Irrelevant scoring

Why MRR Matters for Exact Retrieval
MRR optimization pushes correct chunks to top positions:

Before (Base Model):
Rank 1: Related chunk    (MRR contribution: 0.0)
Rank 2: Irrelevant      (MRR contribution: 0.0)  
Rank 3: CORRECT chunk   (MRR contribution: 0.33)

After (Fine-tuned):
Rank 1: CORRECT chunk   (MRR contribution: 1.0)  ⭐
Rank 2: Related chunk   (MRR contribution: 0.0)
Rank 3: Irrelevant     (MRR contribution: 0.0)

Result: 3x better MRR, users find answers immediately!
Usage
from sentence_transformers import SentenceTransformer
from sklearn.metrics.pairwise import cosine_similarity

# Load MRR-optimized model
model = SentenceTransformer('ThanhLe0125/e5-math-ebd')

# ⚠️ CRITICAL: Must use E5 prefixes
query = "query: Định nghĩa hàm số đồng biến là gì?"
chunks = [
    "passage: Hàm số đồng biến trên khoảng (a;b) là...",  # CORRECT
    "passage: Ví dụ bài tập về hàm đồng biến...",        # RELATED
    "passage: Phương trình bậc hai có dạng..."           # IRRELEVANT
]

# Get MRR-optimized rankings
query_emb = model.encode([query])
chunk_embs = model.encode(chunks)
similarities = cosine_similarity(query_emb, chunk_embs)[0]

# With fine-tuning, correct chunk should be at rank #1
ranked_indices = similarities.argsort()[::-1]
print(f"Rank 1: {chunks[ranked_indices[0]][:50]}... (Score: {similarities[ranked_indices[0]]:.3f})")

# Expected: Correct chunk at rank #1 with high score
Inference Efficiency

With MRR optimization, you typically only need top 1-2 chunks :

# Efficient inference - high probability correct chunk is #1
top_chunk = chunks[similarities.argmax()]
confidence = similarities.max()

if confidence > 0.7:  # High confidence threshold
    return top_chunk  # Likely the correct answer
else:
    return chunks[similarities.argsort()[::-1][:3]]  # Return top 3 as fallback
Evaluation Methodology
  • Training : train_question + val_question with MRR optimization
  • Validation : MRR for early stopping, Recall@3/5 monitoring
  • Test : test_question used once for final comparison
  • Comparison : Direct evaluation against base E5-multilingual model
  • Metrics : MRR, Recall@1,2,3,4,5, Hierarchy Rate
Perfect For

🎯 Educational Q&A : Exact answers at rank #1 consistently ⚡ Efficient Systems : Fewer chunks needed at inference
🇻🇳 Vietnamese Math : Specialized mathematical terminology 📊 Quality Ranking : Hierarchical relevance scoring 🚀 Production Ready : Proven improvement over base model

Technical Notes
  • Base Model : intfloat/multilingual-e5-base
  • Fine-tuning : Hierarchical contrastive learning with MRR optimization
  • Max Sequence : 256 tokens
  • Training Data : Vietnamese mathematical content with expert annotations
  • Validation : Proper train/validation/test split methodology

Fine-tuned on 25/06/2025 with comprehensive base model comparison.

Runs of ThanhLe0125 e5-math-ebd on huggingface.co

102
Total runs
2
24-hour runs
20
3-day runs
7
7-day runs
21
30-day runs

More Information About e5-math-ebd huggingface.co Model

e5-math-ebd huggingface.co

e5-math-ebd huggingface.co is an AI model on huggingface.co that provides e5-math-ebd's model effect (), which can be used instantly with this ThanhLe0125 e5-math-ebd model. huggingface.co supports a free trial of the e5-math-ebd model, and also provides paid use of the e5-math-ebd. Support call e5-math-ebd model through api, including Node.js, Python, http.

ThanhLe0125 e5-math-ebd online free

e5-math-ebd huggingface.co is an online trial and call api platform, which integrates e5-math-ebd's modeling effects, including api services, and provides a free online trial of e5-math-ebd, you can try e5-math-ebd online for free by clicking the link below.

ThanhLe0125 e5-math-ebd online free url in huggingface.co:

https://huggingface.co/ThanhLe0125/e5-math-ebd

e5-math-ebd install

e5-math-ebd is an open source model from GitHub that offers a free installation service, and any user can find e5-math-ebd on GitHub to install. At the same time, huggingface.co provides the effect of e5-math-ebd install, users can directly use e5-math-ebd installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

e5-math-ebd install url in huggingface.co:

https://huggingface.co/ThanhLe0125/e5-math-ebd

Url of e5-math-ebd

Provider of e5-math-ebd huggingface.co

ThanhLe0125
ORGANIZATIONS

Other API from ThanhLe0125

huggingface.co

Total runs: 57
Run Growth: -22
Growth Rate: -38.60%
Updated:July 01 2025
huggingface.co

Total runs: 3
Run Growth: 3
Growth Rate: 100.00%
Updated:December 20 2024
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:December 27 2024
huggingface.co

Total runs: 0
Run Growth: -2
Growth Rate: 0.00%
Updated:December 19 2024