Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,131 @@
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
# Model Card for Model ID
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
|
| 11 |
|
| 12 |
## Model Details
|
| 13 |
|
| 14 |
### Model Description
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
| 18 |
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 19 |
|
| 20 |
-
- **Developed by:**
|
| 21 |
-
- **
|
| 22 |
-
- **
|
| 23 |
-
- **
|
| 24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
-
|
| 28 |
-
### Model Sources [optional]
|
| 29 |
|
| 30 |
-
<!-- Provide the basic links for the model. -->
|
| 31 |
-
|
| 32 |
-
- **Repository:** [More Information Needed]
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
## Uses
|
| 37 |
|
| 38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 39 |
-
|
| 40 |
### Direct Use
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
[More Information Needed]
|
| 45 |
|
| 46 |
-
### Downstream Use [optional]
|
| 47 |
-
|
| 48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
| 49 |
-
|
| 50 |
-
[More Information Needed]
|
| 51 |
-
|
| 52 |
-
### Out-of-Scope Use
|
| 53 |
-
|
| 54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
| 55 |
-
|
| 56 |
-
[More Information Needed]
|
| 57 |
|
| 58 |
## Bias, Risks, and Limitations
|
| 59 |
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
-
[More Information Needed]
|
| 63 |
|
| 64 |
-
|
| 65 |
|
| 66 |
-
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
|
|
|
| 71 |
|
| 72 |
-
|
|
|
|
|
|
|
| 73 |
|
| 74 |
-
[
|
| 75 |
|
| 76 |
## Training Details
|
| 77 |
|
| 78 |
### Training Data
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
[More Information Needed]
|
| 83 |
|
| 84 |
### Training Procedure
|
| 85 |
|
| 86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 87 |
|
| 88 |
#### Preprocessing [optional]
|
| 89 |
|
| 90 |
-
|
| 91 |
-
|
| 92 |
|
| 93 |
#### Training Hyperparameters
|
| 94 |
|
| 95 |
-
- **Training regime:**
|
|
|
|
| 96 |
|
| 97 |
-
#### Speeds, Sizes, Times [optional]
|
| 98 |
|
| 99 |
-
|
| 100 |
|
| 101 |
-
|
| 102 |
|
| 103 |
## Evaluation
|
| 104 |
|
| 105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
| 106 |
|
| 107 |
### Testing Data, Factors & Metrics
|
| 108 |
|
| 109 |
#### Testing Data
|
| 110 |
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
-
|
| 115 |
-
#### Factors
|
| 116 |
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
|
| 121 |
#### Metrics
|
| 122 |
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
|
| 127 |
### Results
|
| 128 |
|
| 129 |
-
|
|
|
|
| 130 |
|
| 131 |
-
#### Summary
|
| 132 |
|
| 133 |
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
-
|
| 141 |
## Environmental Impact
|
| 142 |
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
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).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
-
|
| 159 |
-
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
[More Information Needed]
|
| 162 |
|
| 163 |
-
#### Hardware
|
| 164 |
|
| 165 |
-
[More Information Needed]
|
| 166 |
-
|
| 167 |
-
#### Software
|
| 168 |
-
|
| 169 |
-
[More Information Needed]
|
| 170 |
|
| 171 |
## Citation [optional]
|
| 172 |
|
| 173 |
-
<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
|
| 174 |
-
|
| 175 |
**BibTeX:**
|
| 176 |
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
## Glossary [optional]
|
| 184 |
-
|
| 185 |
-
<!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
|
| 186 |
-
|
| 187 |
-
[More Information Needed]
|
| 188 |
-
|
| 189 |
-
## More Information [optional]
|
| 190 |
-
|
| 191 |
-
[More Information Needed]
|
| 192 |
|
| 193 |
## Model Card Authors [optional]
|
| 194 |
|
| 195 |
-
|
| 196 |
-
|
| 197 |
## Model Card Contact
|
| 198 |
|
| 199 |
-
|
|
|
|
| 1 |
---
|
| 2 |
library_name: transformers
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
metrics:
|
| 6 |
+
- bleu
|
| 7 |
+
pipeline_tag: translation
|
| 8 |
---
|
| 9 |
|
| 10 |
# Model Card for Model ID
|
| 11 |
|
| 12 |
+
Model Card for English-to-Darija Translation (mBART Fine-tuned Model)
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
## Model Details
|
| 16 |
|
| 17 |
### Model Description
|
| 18 |
|
| 19 |
+
This model is a fine-tuned version of the facebook/mbart-large-50-many-to-many-mmt model,
|
| 20 |
+
specifically tailored for translating English text to Moroccan Darija in Arabic script.
|
| 21 |
+
The model was trained on a custom dataset of English-Darija sentence pairs,
|
| 22 |
+
and it has been designed to accurately capture the nuances of the Moroccan dialect.
|
| 23 |
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
| 24 |
|
| 25 |
+
- **Developed by:** Aicha Lahnouki
|
| 26 |
+
- **Finetuned from model:** facebook/mbart-large-50-many-to-many-mmt
|
| 27 |
+
- **Model type:** Sequence-to-Sequence Translation (mBART architecture)
|
| 28 |
+
- **Language(s) (NLP):** English (en_XX), Darija (ar_AR)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
## Uses
|
| 32 |
|
|
|
|
|
|
|
| 33 |
### Direct Use
|
| 34 |
|
| 35 |
+
This model is intended for translating English sentences into Moroccan Darija in Arabic script.
|
| 36 |
+
It can be used in applications such as translation services, language learning tools, or chatbots.
|
|
|
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
|
| 39 |
## Bias, Risks, and Limitations
|
| 40 |
|
| 41 |
+
This model was trained on 50% of the dataset provided by DODa, consisting of 45,000 rows.
|
| 42 |
+
The testing was conducted on a sample of 100 sentences. Due to the reduced training data,
|
| 43 |
+
the model might not capture the full linguistic diversity of English-to-Darija translations.
|
| 44 |
+
Additionally, the limited test size may not fully represent the model's performance across all possible inputs,
|
| 45 |
+
leading to potential biases or inaccuracies when applied to unseen or diverse data.
|
| 46 |
|
|
|
|
| 47 |
|
| 48 |
+
## How to Get Started with the Model
|
| 49 |
|
| 50 |
+
Use the code below to get started with the model.
|
| 51 |
|
| 52 |
+
from transformers import pipeline
|
| 53 |
|
| 54 |
+
# Initialize the translation pipeline
|
| 55 |
+
pipe = pipeline("translation", model="alpha2002/eng_alpha_darija", tokenizer="alpha2002/eng_alpha_darija")
|
| 56 |
|
| 57 |
+
# Translate English to Darija
|
| 58 |
+
input_text = "Hello, how are you?"
|
| 59 |
+
translation = pipe(input_text, src_lang="en_XX", tgt_lang="ar_AR")
|
| 60 |
|
| 61 |
+
print("Translation:", translation[0]['translation_text'])
|
| 62 |
|
| 63 |
## Training Details
|
| 64 |
|
| 65 |
### Training Data
|
| 66 |
|
| 67 |
+
The model was trained on a custom dataset containing parallel English and Darija sentences.
|
| 68 |
+
The dataset was preprocessed to include language tokens specific to mBART's requirements.
|
|
|
|
| 69 |
|
| 70 |
### Training Procedure
|
| 71 |
|
|
|
|
| 72 |
|
| 73 |
#### Preprocessing [optional]
|
| 74 |
|
| 75 |
+
The English text was tokenized with the <en_XX> token, and the Darija text with the <ar_AR> token.
|
|
|
|
| 76 |
|
| 77 |
#### Training Hyperparameters
|
| 78 |
|
| 79 |
+
- **Training regime:** FP16 mixed precision was used during training to improve performance.
|
| 80 |
+
Training was done on Google Colab using a subset of the data, with gradient accumulation to handle larger batch sizes.
|
| 81 |
|
|
|
|
| 82 |
|
| 83 |
+
#### Speeds, Sizes, Times [optional]
|
| 84 |
|
| 85 |
+
The model was trained for 2 epochs with a batch size of 4, using the Seq2SeqTrainer from the Hugging Face Transformers library.
|
| 86 |
|
| 87 |
## Evaluation
|
| 88 |
|
|
|
|
| 89 |
|
| 90 |
### Testing Data, Factors & Metrics
|
| 91 |
|
| 92 |
#### Testing Data
|
| 93 |
|
| 94 |
+
The model was evaluated on a small set of held-out test sentences: 100 samples.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
#### Metrics
|
| 98 |
|
| 99 |
+
BLEU score was used to measure translation accuracy.
|
|
|
|
|
|
|
| 100 |
|
| 101 |
### Results
|
| 102 |
|
| 103 |
+
The model achieved a BLEU score of 11.6 on the test set,
|
| 104 |
+
indicating a reasonable level of accuracy given the complexity of translating between languages with different scripts and linguistic structures.
|
| 105 |
|
|
|
|
| 106 |
|
| 107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
## Environmental Impact
|
| 109 |
|
| 110 |
+
- **Hardware Type:** Google Colab GPU (NVIDIA Tesla K80)
|
| 111 |
+
- **Hours used:** Approximately 2 hours for training and 1hour for testing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
|
|
|
| 113 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
## Citation [optional]
|
| 116 |
|
|
|
|
|
|
|
| 117 |
**BibTeX:**
|
| 118 |
|
| 119 |
+
@misc{lahnouki2024eng_alpha_darija,
|
| 120 |
+
author = {Aicha Lahnouki},
|
| 121 |
+
title = {English-to-Darija Translation Model},
|
| 122 |
+
year = {2024},
|
| 123 |
+
url = {https://huggingface.co/alpha2002/eng_alpha_darija},
|
| 124 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
## Model Card Authors [optional]
|
| 127 |
|
| 128 |
+
Lahnouki Aicha
|
|
|
|
| 129 |
## Model Card Contact
|
| 130 |
|
| 131 |
+
email: aichalahnouki@gmail.com
|