AmanSengar commited on
Commit
21afc66
Β·
verified Β·
1 Parent(s): 0869a24

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +108 -0
README.md ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 🧠 MarianMT-Text-Translation-AI-Model-"en-de"
2
+
3
+ A sequence-to-sequence translation model fine-tuned on English–German sentence pairs. This model translates English text into German and is built using the Hugging Face MarianMTModel. It’s suitable for general-purpose translation, language learning, and formal or semi-formal communication across English and German.
4
+
5
+ ---
6
+
7
+ ## ✨ Model Highlights
8
+
9
+ - πŸ“Œ Base Model: Helsinki-NLP/opus-mt-en-de
10
+ - πŸ“š Fine-tuned on a cleaned and tokenized parallel English-German dataset
11
+ - 🌍 Direction: English β†’ German
12
+ - πŸ”§ Framework: Hugging Face Transformers + PyTorch
13
+
14
+ ---
15
+
16
+ ## 🧠 Intended Uses
17
+
18
+ - βœ… Translating English content (emails, documentation, support text) into German
19
+ - βœ… Use in educational platforms for learning German
20
+ - βœ… Supporting cross-lingual customer service, product documentation, or semi-formal communications
21
+
22
+ ---
23
+
24
+ ## 🚫 Limitations
25
+
26
+ - ❌ Not optimized for informal, idiomatic, or slang expressions
27
+ - ❌ Not ideal for legal, medical, or sensitive content translation
28
+ - πŸ“ Sentences longer than 128 tokens are truncated
29
+ - ⚠️ Domain-specific accuracy may vary (e.g., legal, technical)
30
+
31
+ ---
32
+
33
+ ## πŸ‹οΈβ€β™‚οΈ Training Details
34
+
35
+ | Attribute | Value |
36
+ |--------------------|----------------------------------|
37
+ | Base Model | `Helsinki-NLP/opus-mt-en-de` |
38
+ | Dataset | WMT14 English-German |
39
+ | Task Type | Translation |
40
+ | Max Token Length | 128 |
41
+ | Epochs | 3 |
42
+ | Batch Size | 16 |
43
+ | Optimizer | AdamW |
44
+ | Loss Function | CrossEntropyLoss |
45
+ | Framework | PyTorch + Transformers |
46
+ | Hardware | CUDA-enabled GPU |
47
+
48
+ ---
49
+
50
+ ## πŸ“Š Evaluation Metrics
51
+
52
+ | Metric | Score |
53
+ |------------|---------|
54
+ | BLEU Score | 30.42 |
55
+
56
+ ---
57
+
58
+ ## πŸ”Ž Output Details
59
+
60
+ - Input: English text string
61
+ - Output: Translated German text string
62
+
63
+ ---
64
+
65
+ ## πŸš€ Usage
66
+
67
+ ```python
68
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
69
+ import torch
70
+
71
+ model_name = "AventIQ-AI/Ai-Translate-Model-Eng-German"
72
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
73
+ model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
74
+ model.eval()
75
+
76
+ def translate(text):
77
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
78
+ model.to(device)
79
+ inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True).to(device)
80
+ outputs = model.generate(**inputs)
81
+ return tokenizer.decode(outputs[0], skip_special_tokens=True)
82
+
83
+ # Example
84
+ print(translate("How are you doing today?"))
85
+
86
+ ```
87
+ ---
88
+
89
+ ## πŸ“ Repository Structure
90
+ ```
91
+ finetuned-model/
92
+ β”œβ”€β”€ config.json βœ… Model architecture & config
93
+ β”œβ”€β”€ pytorch_model.bin βœ… Model weights
94
+ β”œβ”€β”€ tokenizer_config.json βœ… Tokenizer settings
95
+ β”œβ”€β”€ tokenizer.json βœ… Tokenizer vocabulary (JSON format)
96
+ β”œβ”€β”€ source.spm βœ… SentencePiece model for source language
97
+ β”œβ”€β”€ target.spm βœ… SentencePiece model for target language
98
+ β”œβ”€β”€ special_tokens_map.json βœ… Special tokens mapping
99
+ β”œβ”€β”€ generation_config.json βœ… (Optional) Generation defaults
100
+ β”œβ”€β”€ README.md βœ… Model card
101
+
102
+ ```
103
+
104
+ ## 🀝 Contributing
105
+ Contributions are welcome! Feel free to open an issue or pull request to improve the model, training scripts, or documentation.
106
+
107
+
108
+