ashaduzzaman
commited on
Commit
•
260b75a
1
Parent(s):
51b7c37
Update README.md
Browse files
README.md
CHANGED
@@ -9,56 +9,100 @@ metrics:
|
|
9 |
model-index:
|
10 |
- name: t5-small-finetuned-opus-books
|
11 |
results: []
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
---
|
13 |
|
14 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
15 |
should probably proofread and complete it, then remove this comment. -->
|
16 |
|
|
|
17 |
# t5-small-finetuned-opus-books
|
18 |
|
19 |
-
This model is a fine-tuned version of [google-t5/t5-small](https://huggingface.co/google-t5/t5-small) on
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
-
|
24 |
|
25 |
-
|
|
|
|
|
|
|
26 |
|
27 |
-
|
28 |
|
29 |
-
|
|
|
|
|
|
|
30 |
|
31 |
-
|
|
|
|
|
|
|
32 |
|
33 |
-
## Training and
|
34 |
|
35 |
-
|
|
|
|
|
36 |
|
37 |
-
|
|
|
|
|
38 |
|
39 |
-
|
40 |
|
41 |
-
|
42 |
-
-
|
43 |
-
-
|
44 |
-
-
|
45 |
-
-
|
46 |
-
-
|
47 |
-
-
|
48 |
-
-
|
49 |
-
-
|
50 |
|
51 |
-
### Training
|
52 |
|
53 |
| Training Loss | Epoch | Step | Validation Loss | Bleu | Gen Len |
|
54 |
|:-------------:|:-----:|:----:|:---------------:|:------:|:-------:|
|
55 |
| 2.2831 | 1.0 | 500 | 1.9888 | 3.0971 | 17.7335 |
|
56 |
| 2.2008 | 2.0 | 1000 | 1.9653 | 3.1445 | 17.716 |
|
57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
-
|
60 |
|
61 |
-
|
62 |
-
- Pytorch 2.3.1+cu121
|
63 |
-
- Datasets 2.21.0
|
64 |
-
- Tokenizers 0.19.1
|
|
|
9 |
model-index:
|
10 |
- name: t5-small-finetuned-opus-books
|
11 |
results: []
|
12 |
+
datasets:
|
13 |
+
- Helsinki-NLP/opus_books
|
14 |
+
language:
|
15 |
+
- en
|
16 |
+
- fr
|
17 |
+
pipeline_tag: translation
|
18 |
---
|
19 |
|
20 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
21 |
should probably proofread and complete it, then remove this comment. -->
|
22 |
|
23 |
+
|
24 |
# t5-small-finetuned-opus-books
|
25 |
|
26 |
+
This model is a fine-tuned version of [google-t5/t5-small](https://huggingface.co/google-t5/t5-small) on the Opus Books dataset. The model is trained to perform various text-to-text tasks such as translation, summarization, and text generation, with a focus on book-related content.
|
27 |
+
|
28 |
+
## Model Description
|
29 |
+
|
30 |
+
The T5 architecture, or Text-To-Text Transfer Transformer, converts all NLP tasks into a text-to-text format, allowing a single model to be fine-tuned for different NLP tasks. This particular model, `t5-small-finetuned-opus-books`, is fine-tuned on a subset of the Opus Books dataset, which includes multilingual parallel texts derived from books.
|
31 |
|
32 |
+
### Key Features:
|
33 |
+
- **Base Model**: [google-t5/t5-small](https://huggingface.co/google-t5/t5-small)
|
34 |
+
- **Architecture**: T5 (Text-to-Text Transfer Transformer) - a versatile model that can be adapted to a variety of NLP tasks.
|
35 |
+
- **Fine-tuning**: Adapted for tasks involving book-related content such as translation, summarization, and paraphrasing.
|
36 |
|
37 |
+
## Intended Uses & Limitations
|
38 |
|
39 |
+
### Intended Uses:
|
40 |
+
- **Book Translation**: Translating text from one language to another, particularly for book content.
|
41 |
+
- **Summarization**: Generating concise summaries of longer texts, particularly from books.
|
42 |
+
- **Text Generation**: Creating new text based on given prompts, useful for creative writing or content generation related to books.
|
43 |
|
44 |
+
### Limitations:
|
45 |
+
- **Generalization**: The model is fine-tuned on a specific dataset, which may limit its performance on texts that are vastly different from book-related content.
|
46 |
+
- **Bleu Score**: With a BLEU score of 3.1445, the model's translation performance might be modest compared to more specialized translation models.
|
47 |
+
- **Generation Length**: The generated text tends to be relatively short (average length: 17.716 tokens), which may not be ideal for tasks requiring longer outputs.
|
48 |
|
49 |
+
## Training and Evaluation Data
|
50 |
|
51 |
+
### Dataset:
|
52 |
+
- **Training Data**: The Opus Books dataset, which includes multilingual text pairs from various books. This dataset is particularly rich in literary and academic content, making it suitable for training models focused on book-related NLP tasks.
|
53 |
+
- **Evaluation Data**: A subset of the Opus Books dataset was used to evaluate the model's performance.
|
54 |
|
55 |
+
### Data Characteristics:
|
56 |
+
- **Domain**: Book content, including fiction and non-fiction across various genres.
|
57 |
+
- **Languages**: Multilingual, with a focus on pairs involving English.
|
58 |
|
59 |
+
## Training Procedure
|
60 |
|
61 |
+
### Training Hyperparameters:
|
62 |
+
- **Learning Rate**: 2e-05
|
63 |
+
- **Train Batch Size**: 16
|
64 |
+
- **Eval Batch Size**: 16
|
65 |
+
- **Seed**: 42
|
66 |
+
- **Optimizer**: Adam with betas=(0.9, 0.999) and epsilon=1e-08
|
67 |
+
- **Learning Rate Scheduler Type**: Linear
|
68 |
+
- **Number of Epochs**: 2
|
69 |
+
- **Mixed Precision Training**: Native AMP (Automatic Mixed Precision) to optimize training time and memory usage.
|
70 |
|
71 |
+
### Training Results:
|
72 |
|
73 |
| Training Loss | Epoch | Step | Validation Loss | Bleu | Gen Len |
|
74 |
|:-------------:|:-----:|:----:|:---------------:|:------:|:-------:|
|
75 |
| 2.2831 | 1.0 | 500 | 1.9888 | 3.0971 | 17.7335 |
|
76 |
| 2.2008 | 2.0 | 1000 | 1.9653 | 3.1445 | 17.716 |
|
77 |
|
78 |
+
- **Final Validation Loss**: 1.9653
|
79 |
+
- **Final BLEU Score**: 3.1445
|
80 |
+
- **Generation Length**: Average of 17.716 tokens per output.
|
81 |
+
|
82 |
+
### Framework Versions
|
83 |
+
- **Transformers**: 4.42.4
|
84 |
+
- **PyTorch**: 2.3.1+cu121
|
85 |
+
- **Datasets**: 2.21.0
|
86 |
+
- **Tokenizers**: 0.19.1
|
87 |
+
|
88 |
+
## Usage
|
89 |
+
|
90 |
+
You can use this model in a Hugging Face pipeline for various text-to-text tasks:
|
91 |
+
|
92 |
+
```python
|
93 |
+
from transformers import pipeline
|
94 |
+
|
95 |
+
translator = pipeline(
|
96 |
+
"translation_en_to_fr",
|
97 |
+
model="ashaduzzaman/t5-small-finetuned-opus-books"
|
98 |
+
)
|
99 |
+
|
100 |
+
# Example usage: Translation
|
101 |
+
text = "translate English to French: Legumes share resources with nitrogen-fixing bacteria."
|
102 |
+
|
103 |
+
print(translator(text))
|
104 |
+
```
|
105 |
|
106 |
+
## Acknowledgments
|
107 |
|
108 |
+
This model was developed using the [Hugging Face Transformers](https://huggingface.co/transformers) library and fine-tuned on the Opus Books dataset. Special thanks to the Opus project for providing a rich source of multilingual book content.
|
|
|
|
|
|