Create README.md
Browse files
    	
        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 | 
         
            +
             
     |