BounharAbdelaziz commited on
Commit
4ccb9b9
1 Parent(s): f8381b3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +52 -15
README.md CHANGED
@@ -6,36 +6,73 @@ tags:
6
  metrics:
7
  - bleu
8
  model-index:
9
- - name: Terjman-Nano-MAX_LEN-512
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-Nano-MAX_LEN-512
 
17
 
18
- This model is a fine-tuned version of [Helsinki-NLP/opus-mt-en-ar](https://huggingface.co/Helsinki-NLP/opus-mt-en-ar) on an unknown dataset.
19
  It achieves the following results on the evaluation set:
20
  - Loss: 3.2038
21
  - Bleu: 10.6239
22
  - Gen Len: 35.2727
23
 
24
- ## Model description
25
 
26
- More information needed
27
 
28
- ## Intended uses & limitations
 
 
29
 
30
- More information needed
 
31
 
32
- ## Training and evaluation data
 
 
33
 
34
- More information needed
 
35
 
36
- ## Training procedure
 
37
 
38
- ### Training hyperparameters
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  The following hyperparameters were used during training:
41
  - learning_rate: 3e-05
@@ -49,7 +86,7 @@ The following hyperparameters were used during training:
49
  - lr_scheduler_warmup_ratio: 0.03
50
  - num_epochs: 40
51
 
52
- ### Training results
53
 
54
  | Training Loss | Epoch | Step | Validation Loss | Bleu | Gen Len |
55
  |:-------------:|:-------:|:----:|:---------------:|:-------:|:-------:|
@@ -95,7 +132,7 @@ The following hyperparameters were used during training:
95
  | 3.524 | 39.9287 | 5600 | 3.2038 | 10.6239 | 35.2727 |
96
 
97
 
98
- ### Framework versions
99
 
100
  - Transformers 4.40.2
101
  - Pytorch 2.2.1+cu121
 
6
  metrics:
7
  - bleu
8
  model-index:
9
+ - name: Terjman-Nano
10
  results: []
11
+ datasets:
12
+ - atlasia/darija_english
13
+ language:
14
+ - ar
15
+ - en
16
  ---
17
 
18
+ # Terjman-Nano (77M params)
 
19
 
20
+ Our model is built upon the powerful Transformer architecture, leveraging state-of-the-art natural language processing techniques.
21
+ It is a fine-tuned version of [Helsinki-NLP/opus-mt-en-ar](https://huggingface.co/Helsinki-NLP/opus-mt-en-ar) on a the [darija_english](atlasia/darija_english) dataset enhanced with curated corpora ensuring high-quality and accurate translations.
22
 
 
23
  It achieves the following results on the evaluation set:
24
  - Loss: 3.2038
25
  - Bleu: 10.6239
26
  - Gen Len: 35.2727
27
 
 
28
 
29
+ ## Usage
30
 
31
+ Using our model for translation is simple and straightforward.
32
+ You can integrate it into your projects or workflows via the Hugging Face Transformers library.
33
+ Here's a basic example of how to use the model in Python:
34
 
35
+ ```python
36
+ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
37
 
38
+ # Load the tokenizer and model
39
+ tokenizer = AutoTokenizer.from_pretrained("atlasia/Terjman-Nano")
40
+ model = AutoModelForSeq2SeqLM.from_pretrained("atlasia/Terjman-Nano")
41
 
42
+ # Define your Moroccan Darija Arabizi text
43
+ input_text = "Your english text goes here."
44
 
45
+ # Tokenize the input text
46
+ input_tokens = tokenizer(input_text, return_tensors="pt", padding=True, truncation=True)
47
 
48
+ # Perform translation
49
+ output_tokens = model.generate(**input_tokens)
50
+
51
+ # Decode the output tokens
52
+ output_text = tokenizer.decode(output_tokens[0], skip_special_tokens=True)
53
+
54
+ print("Translation:", output_text)
55
+ ```
56
+
57
+ ## Example
58
+
59
+ Let's see an example of transliterating Moroccan Darija Arabizi to Arabic:
60
+
61
+ **Input**: "Hi my friend, can you tell me a joke in moroccan darija? I'd be happy to hear that from you!"
62
+
63
+ **Output**: "مرحبا يا صديقي، يمكن تقال لي نكتة فالداريا المغاربية؟ أنا سَأكُونُ سعيد بسمْاع هادشي منك!"
64
+
65
+ ## Limiations
66
+
67
+ This version has some limitations mainly due to the Tokenizer.
68
+ We're currently collecting more data with the aim of continous improvements.
69
+
70
+ ## Feedback
71
+
72
+ We're continuously striving to improve our model's performance and usability and we will be improving it incrementaly.
73
+ If you have any feedback, suggestions, or encounter any issues, please don't hesitate to reach out to us.
74
+
75
+ ## Training hyperparameters
76
 
77
  The following hyperparameters were used during training:
78
  - learning_rate: 3e-05
 
86
  - lr_scheduler_warmup_ratio: 0.03
87
  - num_epochs: 40
88
 
89
+ ## Training results
90
 
91
  | Training Loss | Epoch | Step | Validation Loss | Bleu | Gen Len |
92
  |:-------------:|:-------:|:----:|:---------------:|:-------:|:-------:|
 
132
  | 3.524 | 39.9287 | 5600 | 3.2038 | 10.6239 | 35.2727 |
133
 
134
 
135
+ ## Framework versions
136
 
137
  - Transformers 4.40.2
138
  - Pytorch 2.2.1+cu121