abhik1505040
commited on
Commit
•
dd2174d
1
Parent(s):
7e90aca
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- bn
|
4 |
+
- en
|
5 |
+
tags:
|
6 |
+
- translation
|
7 |
+
licenses:
|
8 |
+
- cc-by-nc-sa-4.0
|
9 |
+
---
|
10 |
+
|
11 |
+
# banglat5_nmt_bn_en
|
12 |
+
|
13 |
+
This repository contains the **BanglaT5** checkpoint finetuned on the [BanglaNMT]() Bengali-English dataset.
|
14 |
+
|
15 |
+
**Note**: This model was pretrained using a specific normalization pipeline available [here](https://github.com/csebuetnlp/normalizer). All finetuning scripts in the official GitHub repository use this normalization by default. If you need to adapt the pretrained model for a different task make sure the text units are normalized using this pipeline before tokenizing to get best results. A basic example is given below:
|
16 |
+
|
17 |
+
## Using this model in `transformers` (tested on 4.11.0.dev0)
|
18 |
+
|
19 |
+
```python
|
20 |
+
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
|
21 |
+
from normalizer import normalize # pip install git+https://github.com/csebuetnlp/normalizer
|
22 |
+
|
23 |
+
model = AutoModelForSeq2SeqLM.from_pretrained("csebuetnlp/banglat5_nmt_bn_en")
|
24 |
+
tokenizer = AutoTokenizer.from_pretrained("csebuetnlp/banglat5_nmt_bn_en", use_fast=False)
|
25 |
+
|
26 |
+
input_sentence = ""
|
27 |
+
input_ids = tokenizer(normalize(input_sentence), return_tensors="pt").input_ids
|
28 |
+
generated_tokens = model.generate(input_ids)
|
29 |
+
decoded_tokens = tokenizer.batch_decode(generated_tokens)[0]
|
30 |
+
|
31 |
+
print(decoded_tokens)
|
32 |
+
```
|
33 |
+
|
34 |
+
## Benchmarks
|
35 |
+
|
36 |
+
* On BanglaNMT test set:
|
37 |
+
|
38 |
+
| Model | Params | MT (SacreBLEU) |
|
39 |
+
|--------------------|------------|-----------------------|
|
40 |
+
|[mT5 (base)](https://huggingface.co/google/mt5-base) | 582M | 36.6 |
|
41 |
+
|[XLM-ProphetNet](https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased) | 616M | 23.3 |
|
42 |
+
|[mBART-50](https://huggingface.co/facebook/mbart-large-50) | 611M | 23.6 |
|
43 |
+
|[IndicBART](https://huggingface.co/ai4bharat/IndicBART) | 244M | 22.7 |
|
44 |
+
|[BanglaT5](https://huggingface.co/csebuetnlp/banglat5) | 247M | 38.8 |
|
45 |
+
|
46 |
+
|
47 |
+
|
48 |
+
## Citation
|
49 |
+
|
50 |
+
If you use this model, please cite the following paper:
|
51 |
+
```
|
52 |
+
@article{bhattacharjee2022banglanlg,
|
53 |
+
author = {Abhik Bhattacharjee and Tahmid Hasan and Wasi Uddin Ahmad and Rifat Shahriyar},
|
54 |
+
title = {BanglaNLG: Benchmarks and Resources for Evaluating Low-Resource Natural Language Generation in Bangla},
|
55 |
+
journal = {CoRR},
|
56 |
+
volume = {abs/2205.11081},
|
57 |
+
year = {2022},
|
58 |
+
url = {https://arxiv.org/abs/2205.11081},
|
59 |
+
eprinttype = {arXiv},
|
60 |
+
eprint = {2205.11081}
|
61 |
+
}
|
62 |
+
```
|
63 |
+
|
64 |
+
|
65 |
+
If you use the normalization module, please cite the following paper:
|
66 |
+
```
|
67 |
+
@inproceedings{hasan-etal-2020-low,
|
68 |
+
title = "Not Low-Resource Anymore: Aligner Ensembling, Batch Filtering, and New Datasets for {B}engali-{E}nglish Machine Translation",
|
69 |
+
author = "Hasan, Tahmid and
|
70 |
+
Bhattacharjee, Abhik and
|
71 |
+
Samin, Kazi and
|
72 |
+
Hasan, Masum and
|
73 |
+
Basak, Madhusudan and
|
74 |
+
Rahman, M. Sohel and
|
75 |
+
Shahriyar, Rifat",
|
76 |
+
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
|
77 |
+
month = nov,
|
78 |
+
year = "2020",
|
79 |
+
address = "Online",
|
80 |
+
publisher = "Association for Computational Linguistics",
|
81 |
+
url = "https://www.aclweb.org/anthology/2020.emnlp-main.207",
|
82 |
+
doi = "10.18653/v1/2020.emnlp-main.207",
|
83 |
+
pages = "2612--2623",
|
84 |
+
abstract = "Despite being the seventh most widely spoken language in the world, Bengali has received much less attention in machine translation literature due to being low in resources. Most publicly available parallel corpora for Bengali are not large enough; and have rather poor quality, mostly because of incorrect sentence alignments resulting from erroneous sentence segmentation, and also because of a high volume of noise present in them. In this work, we build a customized sentence segmenter for Bengali and propose two novel methods for parallel corpus creation on low-resource setups: aligner ensembling and batch filtering. With the segmenter and the two methods combined, we compile a high-quality Bengali-English parallel corpus comprising of 2.75 million sentence pairs, more than 2 million of which were not available before. Training on neural models, we achieve an improvement of more than 9 BLEU score over previous approaches to Bengali-English machine translation. We also evaluate on a new test set of 1000 pairs made with extensive quality control. We release the segmenter, parallel corpus, and the evaluation set, thus elevating Bengali from its low-resource status. To the best of our knowledge, this is the first ever large scale study on Bengali-English machine translation. We believe our study will pave the way for future research on Bengali-English machine translation as well as other low-resource languages. Our data and code are available at https://github.com/csebuetnlp/banglanmt.",
|
85 |
+
}
|
86 |
+
```
|
87 |
+
|
88 |
+
|