BounharAbdelaziz
commited on
Commit
•
e55dc2e
1
Parent(s):
2865327
Update README.md
Browse files
README.md
CHANGED
@@ -1,41 +1,82 @@
|
|
1 |
---
|
2 |
license: cc-by-nc-4.0
|
3 |
base_model: facebook/nllb-200-1.3B
|
4 |
-
tags:
|
5 |
-
- generated_from_trainer
|
6 |
metrics:
|
7 |
- bleu
|
8 |
model-index:
|
9 |
- name: Terjman-Ultra
|
10 |
results: []
|
|
|
|
|
|
|
|
|
|
|
11 |
---
|
12 |
|
13 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
14 |
should probably proofread and complete it, then remove this comment. -->
|
15 |
|
16 |
-
# Terjman-Ultra
|
|
|
|
|
|
|
17 |
|
18 |
-
This model is a fine-tuned version of [facebook/nllb-200-1.3B](https://huggingface.co/facebook/nllb-200-1.3B) on an unknown dataset.
|
19 |
It achieves the following results on the evaluation set:
|
20 |
- Loss: 2.7070
|
21 |
- Bleu: 4.6998
|
22 |
- Gen Len: 35.6088
|
23 |
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
-
|
27 |
|
28 |
-
|
29 |
|
30 |
-
|
31 |
|
32 |
-
|
|
|
33 |
|
34 |
-
|
35 |
|
36 |
-
|
|
|
37 |
|
38 |
-
|
39 |
|
40 |
The following hyperparameters were used during training:
|
41 |
- learning_rate: 3e-05
|
@@ -49,7 +90,7 @@ The following hyperparameters were used during training:
|
|
49 |
- lr_scheduler_warmup_ratio: 0.03
|
50 |
- num_epochs: 25
|
51 |
|
52 |
-
|
53 |
|
54 |
| Training Loss | Epoch | Step | Validation Loss | Bleu | Gen Len |
|
55 |
|:-------------:|:-------:|:-----:|:---------------:|:------:|:-------:|
|
@@ -80,7 +121,7 @@ The following hyperparameters were used during training:
|
|
80 |
| 2.8129 | 24.9972 | 56050 | 2.7070 | 4.6998 | 35.6088 |
|
81 |
|
82 |
|
83 |
-
|
84 |
|
85 |
- Transformers 4.40.2
|
86 |
- Pytorch 2.2.1+cu121
|
|
|
1 |
---
|
2 |
license: cc-by-nc-4.0
|
3 |
base_model: facebook/nllb-200-1.3B
|
|
|
|
|
4 |
metrics:
|
5 |
- bleu
|
6 |
model-index:
|
7 |
- name: Terjman-Ultra
|
8 |
results: []
|
9 |
+
datasets:
|
10 |
+
- atlasia/darija_english
|
11 |
+
language:
|
12 |
+
- ar
|
13 |
+
- en
|
14 |
---
|
15 |
|
16 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
17 |
should probably proofread and complete it, then remove this comment. -->
|
18 |
|
19 |
+
# Terjman-Ultra (1.3B)
|
20 |
+
|
21 |
+
Our model is built upon the powerful Transformer architecture, leveraging state-of-the-art natural language processing techniques.
|
22 |
+
It is a fine-tuned version of [facebook/nllb-200-1.3B](https://huggingface.co/facebook/nllb-200-1.3B) on a the [darija_english](atlasia/darija_english) dataset enhanced with curated corpora ensuring high-quality and accurate translations.
|
23 |
|
|
|
24 |
It achieves the following results on the evaluation set:
|
25 |
- Loss: 2.7070
|
26 |
- Bleu: 4.6998
|
27 |
- Gen Len: 35.6088
|
28 |
|
29 |
+
The finetuning was conducted using a **A100-40GB** and took **32 hours**.
|
30 |
+
|
31 |
+
Try it out on our dedicated [Terjman-Ultra Space](https://huggingface.co/spaces/atlasia/Terjman-Ultra) 🤗
|
32 |
+
|
33 |
+
## Usage
|
34 |
+
|
35 |
+
Using our model for translation is simple and straightforward.
|
36 |
+
You can integrate it into your projects or workflows via the Hugging Face Transformers library.
|
37 |
+
Here's a basic example of how to use the model in Python:
|
38 |
+
|
39 |
+
```python
|
40 |
+
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
41 |
+
|
42 |
+
# Load the tokenizer and model
|
43 |
+
tokenizer = AutoTokenizer.from_pretrained("atlasia/Terjman-Ultra")
|
44 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("atlasia/Terjman-Ultra")
|
45 |
+
|
46 |
+
# Define your Moroccan Darija Arabizi text
|
47 |
+
input_text = "Your english text goes here."
|
48 |
+
|
49 |
+
# Tokenize the input text
|
50 |
+
input_tokens = tokenizer(input_text, return_tensors="pt", padding=True, truncation=True)
|
51 |
+
|
52 |
+
# Perform translation
|
53 |
+
output_tokens = model.generate(**input_tokens)
|
54 |
+
|
55 |
+
# Decode the output tokens
|
56 |
+
output_text = tokenizer.decode(output_tokens[0], skip_special_tokens=True)
|
57 |
+
|
58 |
+
print("Translation:", output_text)
|
59 |
+
```
|
60 |
+
|
61 |
+
## Example
|
62 |
+
|
63 |
+
Let's see an example of transliterating Moroccan Darija Arabizi to Arabic:
|
64 |
|
65 |
+
**Input**: "Hi my friend, can you tell me a joke in moroccan darija? I'd be happy to hear that from you!"
|
66 |
|
67 |
+
**Output**: "أهلا صاحبي، تقدر تقولي مزحة بالدارجة المغربية؟ غادي نكون فرحان باش نسمعها منك!"
|
68 |
|
69 |
+
## Limiations
|
70 |
|
71 |
+
This version has some limitations mainly due to the Tokenizer.
|
72 |
+
We're currently collecting more data with the aim of continous improvements.
|
73 |
|
74 |
+
## Feedback
|
75 |
|
76 |
+
We're continuously striving to improve our model's performance and usability and we will be improving it incrementaly.
|
77 |
+
If you have any feedback, suggestions, or encounter any issues, please don't hesitate to reach out to us.
|
78 |
|
79 |
+
## Training hyperparameters
|
80 |
|
81 |
The following hyperparameters were used during training:
|
82 |
- learning_rate: 3e-05
|
|
|
90 |
- lr_scheduler_warmup_ratio: 0.03
|
91 |
- num_epochs: 25
|
92 |
|
93 |
+
## Training results
|
94 |
|
95 |
| Training Loss | Epoch | Step | Validation Loss | Bleu | Gen Len |
|
96 |
|:-------------:|:-------:|:-----:|:---------------:|:------:|:-------:|
|
|
|
121 |
| 2.8129 | 24.9972 | 56050 | 2.7070 | 4.6998 | 35.6088 |
|
122 |
|
123 |
|
124 |
+
## Framework versions
|
125 |
|
126 |
- Transformers 4.40.2
|
127 |
- Pytorch 2.2.1+cu121
|