DeepakKumarMSL commited on
Commit
c0a7b02
Β·
verified Β·
1 Parent(s): e589db0

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +62 -0
README.md ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## 🧠 English to Spanish Translation AI Model
2
+
3
+ This repository contains a Transformer-based AI model fine-tuned for English to Spanish text translation. The model has been trained, quantized (FP16), and tested for quality and scoring. It delivers high-accuracy translations and is suitable for real-world use cases such as educational tools, real-time communication, and travel assistants.
4
+
5
+ ---
6
+
7
+ ## πŸš€ Features
8
+
9
+ - πŸ” **Language Pair**: English β†’ Spanish
10
+ - πŸ”§ **Model**: Helsinki-NLP/opus-mt-en-es
11
+ - πŸ§ͺ **Quantized**: FP16 for efficient inference
12
+ - 🎯 **High Accuracy**: Scored well on validation sets
13
+ - ⚑ **CUDA Enabled**: Fast training and inference
14
+
15
+ ---
16
+
17
+ ## πŸ“Š Dataset Used
18
+
19
+ **Hugging Face Dataset**: **OscarNav/spa-eng**
20
+
21
+ - Source: OscarNav
22
+ - Language Pair: `en-es`
23
+ - Dataset Size: ~107K sentence pairs
24
+
25
+ ```python
26
+ from datasets import load_dataset
27
+
28
+ dataset = load_dataset("OscarNav/spa-eng", lang1="en", lang2="es")
29
+ ```
30
+
31
+ ## πŸ› οΈ Model Training & Fine-Tuning
32
+
33
+ - Pretrained Base Model: Helsinki-NLP/opus-mt-en-es
34
+
35
+ - Tokenizer: AutoTokenizer from Hugging Face Transformers
36
+
37
+ - Training Environment: Kaggle Notebook with CUDA GPU
38
+
39
+ - Batch Size: 16
40
+
41
+ - Epochs: 3–5 (based on early stopping)
42
+
43
+ - Optimizer: AdamW
44
+
45
+ - Loss Function: CrossEntropyLoss
46
+
47
+
48
+ ## πŸ§ͺ Quantization (FP16)
49
+
50
+ Quantized the model for reduced memory usage and faster inference without compromising translation quality.
51
+
52
+ ```python
53
+ model = model.half()
54
+ model.save_pretrained("quantized_model_fp16")
55
+ ```
56
+
57
+ ## βœ… Scoring
58
+ BLEU Score: ~34+
59
+
60
+ - Evaluation Metric: sacrebleu on validation set
61
+
62
+ - Inference Accuracy: Verified using real-world sample sentences