Update README.md
Browse files
README.md
CHANGED
@@ -11,199 +11,85 @@ base_model:
|
|
11 |
- aryaumesh/english-to-telugu
|
12 |
---
|
13 |
|
14 |
-
# Model Card for Model ID
|
15 |
|
16 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
17 |
-
Text-to-Text Transformer (Language Translation) English->Telugu
|
18 |
|
|
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
- **
|
34 |
-
- **
|
35 |
-
- **
|
36 |
-
- **
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
-
|
44 |
-
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
##
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
97 |
-
|
98 |
-
#### Preprocessing [optional]
|
99 |
-
|
100 |
-
[More Information Needed]
|
101 |
-
|
102 |
-
|
103 |
-
#### Training Hyperparameters
|
104 |
-
|
105 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
106 |
-
|
107 |
-
#### Speeds, Sizes, Times [optional]
|
108 |
-
|
109 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
110 |
-
|
111 |
-
[More Information Needed]
|
112 |
-
|
113 |
-
## Evaluation
|
114 |
-
|
115 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
116 |
-
|
117 |
-
### Testing Data, Factors & Metrics
|
118 |
-
|
119 |
-
#### Testing Data
|
120 |
-
|
121 |
-
<!-- This should link to a Dataset Card if possible. -->
|
122 |
-
|
123 |
-
[More Information Needed]
|
124 |
-
|
125 |
-
#### Factors
|
126 |
-
|
127 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
128 |
-
|
129 |
-
[More Information Needed]
|
130 |
-
|
131 |
-
#### Metrics
|
132 |
-
|
133 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
134 |
-
|
135 |
-
[More Information Needed]
|
136 |
-
|
137 |
-
### Results
|
138 |
-
|
139 |
-
[More Information Needed]
|
140 |
-
|
141 |
-
#### Summary
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
## Model Examination [optional]
|
146 |
-
|
147 |
-
<!-- Relevant interpretability work for the model goes here -->
|
148 |
-
|
149 |
-
[More Information Needed]
|
150 |
-
|
151 |
-
## Environmental Impact
|
152 |
-
|
153 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
154 |
-
|
155 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
156 |
-
|
157 |
-
- **Hardware Type:** [More Information Needed]
|
158 |
-
- **Hours used:** [More Information Needed]
|
159 |
-
- **Cloud Provider:** [More Information Needed]
|
160 |
-
- **Compute Region:** [More Information Needed]
|
161 |
-
- **Carbon Emitted:** [More Information Needed]
|
162 |
-
|
163 |
-
## Technical Specifications [optional]
|
164 |
-
|
165 |
-
### Model Architecture and Objective
|
166 |
-
|
167 |
-
[More Information Needed]
|
168 |
-
|
169 |
-
### Compute Infrastructure
|
170 |
-
|
171 |
-
[More Information Needed]
|
172 |
-
|
173 |
-
#### Hardware
|
174 |
-
|
175 |
-
[More Information Needed]
|
176 |
-
|
177 |
-
#### Software
|
178 |
-
|
179 |
-
[More Information Needed]
|
180 |
-
|
181 |
-
## Citation [optional]
|
182 |
-
|
183 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
184 |
-
|
185 |
-
**BibTeX:**
|
186 |
-
|
187 |
-
[More Information Needed]
|
188 |
-
|
189 |
-
**APA:**
|
190 |
-
|
191 |
-
[More Information Needed]
|
192 |
-
|
193 |
-
## Glossary [optional]
|
194 |
-
|
195 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
196 |
-
|
197 |
-
[More Information Needed]
|
198 |
-
|
199 |
-
## More Information [optional]
|
200 |
-
|
201 |
-
[More Information Needed]
|
202 |
-
|
203 |
-
## Model Card Authors [optional]
|
204 |
-
|
205 |
-
[More Information Needed]
|
206 |
|
207 |
-
|
208 |
|
209 |
-
[More Information Needed]
|
|
|
11 |
- aryaumesh/english-to-telugu
|
12 |
---
|
13 |
|
|
|
14 |
|
|
|
|
|
15 |
|
16 |
+
---
|
17 |
|
18 |
+
# English-to-Telugu Translation Model
|
19 |
+
|
20 |
+
## Overview
|
21 |
+
This project is a deep learning-based English-to-Telugu translation model trained on a custom dataset. It uses Hugging Face Transformers for NLP and was developed in Google Colab. The model can be used for translating sentences with improved contextual accuracy.
|
22 |
+
|
23 |
+
## Features
|
24 |
+
✅ Translates English text to Telugu
|
25 |
+
✅ Trained on a custom bilingual dataset
|
26 |
+
✅ Uses Transformer-based model
|
27 |
+
✅ Implemented and trained in Google Colab
|
28 |
+
✅ Can be fine-tuned for better accuracy
|
29 |
+
|
30 |
+
## Tech Stack
|
31 |
+
- **Programming Language**: Python
|
32 |
+
- **Framework**: Hugging Face Transformers
|
33 |
+
- **Model**: mBART (Fine-tuned)
|
34 |
+
- **Libraries**:
|
35 |
+
- transformers (Hugging Face)
|
36 |
+
- `torch` (PyTorch)
|
37 |
+
- `sentencepiece` (Tokenization)
|
38 |
+
- **Platform**: Google Colab
|
39 |
+
|
40 |
+
## Dataset
|
41 |
+
- Used a custom English-Telugu parallel corpus
|
42 |
+
- Preprocessed using:
|
43 |
+
- **Tokenization** (SentencePiece / WordPiece)
|
44 |
+
- **Lowercasing & Cleaning**
|
45 |
+
- **Removing noisy data**
|
46 |
+
|
47 |
+
## Model Training
|
48 |
+
Training was done in Google Colab using a GPU. Here’s a snippet of the fine-tuning process:
|
49 |
+
|
50 |
+
from transformers import MarianMTModel, MarianTokenizer, Trainer, TrainingArguments
|
51 |
+
|
52 |
+
# Load pre-trained model & tokenizer
|
53 |
+
model_name = "aryaumesh/english-to-telugu" # Base model
|
54 |
+
tokenizer = MarianTokenizer.from_pretrained(model_name)
|
55 |
+
model = MarianMTModel.from_pretrained(model_name)
|
56 |
+
|
57 |
+
# Preprocess dataset (example)
|
58 |
+
def encode_data(texts):
|
59 |
+
return tokenizer(texts, padding=True, truncation=True, return_tensors="pt")
|
60 |
+
|
61 |
+
# Training arguments
|
62 |
+
training_args = TrainingArguments(
|
63 |
+
output_dir="./results",
|
64 |
+
per_device_train_batch_size=8,
|
65 |
+
num_train_epochs=3,
|
66 |
+
save_steps=1000,
|
67 |
+
save_total_limit=2,
|
68 |
+
)
|
69 |
+
|
70 |
+
trainer = Trainer(
|
71 |
+
model=model,
|
72 |
+
args=training_args,
|
73 |
+
train_dataset=custom_dataset,
|
74 |
+
)
|
75 |
+
|
76 |
+
trainer.train()
|
77 |
+
|
78 |
+
## Run the Model
|
79 |
+
|
80 |
+
def translate(text):
|
81 |
+
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)
|
82 |
+
translated = model.generate(**inputs)
|
83 |
+
return tokenizer.decode(translated[0], skip_special_tokens=True)
|
84 |
+
|
85 |
+
english_text = "Good morning, how are you?"
|
86 |
+
telugu_translation = translate(english_text)
|
87 |
+
print("Translated Text:", telugu_translation)
|
88 |
+
|
89 |
+
## Future Improvements
|
90 |
+
🔹 Train on a larger dataset for better accuracy
|
91 |
+
🔹 Optimize inference speed for real-time use
|
92 |
+
🔹 Deploy as a cloud-based API (AWS/GCP)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
+
---
|
95 |
|
|