Banglat5
BanglaT5是基於Span Corruption目標預訓練的孟加拉語序列到序列變換器模型,在多項孟加拉語自然語言生成任務中達到最先進性能。
下載量 1,102
發布時間 : 5/23/2022
模型概述
這是一個專門針對孟加拉語優化的序列到序列變換器模型,通過預訓練和微調可應用於多種自然語言生成任務。
模型特點
孟加拉語優化
專門針對孟加拉語進行預訓練和優化,在多項任務中表現優異
多任務適應性
可通過微調應用於多種自然語言生成任務
文本規範化集成
內置文本規範化流程,確保輸入文本的最佳處理效果
模型能力
機器翻譯
文本摘要
問答系統
對話生成
新聞標題生成
跨語言摘要
使用案例
文本生成
孟加拉語新聞摘要
將孟加拉語新聞文章自動生成簡潔摘要
ROUGE-2得分13.7
英語-孟加拉語機器翻譯
在英語和孟加拉語之間進行雙向翻譯
SacreBLEU得分38.8/25.2
問答系統
孟加拉語問答系統
基於給定文本回答孟加拉語問題
EM/F1得分68.5/74.8
🚀 BanglaT5
BanglaT5 是一個序列到序列的Transformer模型,本倉庫包含該模型的預訓練檢查點。此模型通過 "Span Corruption" 目標進行預訓練。使用此檢查點進行微調的模型在許多孟加拉語自然語言生成(NLG)任務中取得了最先進的成果。
對於不同下游任務(如 機器翻譯
、抽象文本摘要
、問答
等)的微調,請參考官方GitHub 倉庫 中的腳本。
⚠️ 重要提示
該模型使用特定的歸一化管道進行預訓練,可在 此處 獲取。官方GitHub倉庫中的所有微調腳本默認使用此歸一化方法。如果需要將預訓練模型應用於其他任務,請確保在分詞前使用此管道對文本單元進行歸一化處理,以獲得最佳效果。下面給出一個基本示例。
🚀 快速開始
✨ 主要特性
- 基於序列到序列的Transformer架構,通過 "Span Corruption" 目標進行預訓練。
- 在多個孟加拉語NLG任務中取得了最先進的成果。
📦 安裝指南
使用此模型,你需要安裝 transformers
和 normalizer
庫:
pip install transformers
pip install git+https://github.com/csebuetnlp/normalizer
💻 使用示例
基礎用法
以下是在 transformers
庫中使用該模型的示例代碼(測試版本為 4.11.0.dev0):
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
from normalizer import normalize # pip install git+https://github.com/csebuetnlp/normalizer
model = AutoModelForSeq2SeqLM.from_pretrained("csebuetnlp/banglat5")
tokenizer = AutoTokenizer.from_pretrained("csebuetnlp/banglat5", use_fast=False)
input_sentence = ""
input_ids = tokenizer(normalize(input_sentence), return_tensors="pt").input_ids
generated_tokens = model.generate(input_ids)
decoded_tokens = tokenizer.batch_decode(generated_tokens)[0]
print(decoded_tokens)
📚 詳細文檔
Benchmarks
以下是監督微調的基準測試結果:
模型 | 參數數量 | 機器翻譯 (SacreBLEU) | 文本摘要 (ROUGE-2) | 問答 (EM/F1) | 多輪對話生成 (SacreBLEU-1) | 新聞標題生成 (ROUGE-2) | 跨語言摘要 (ROUGE-2) | BNLG 得分 |
---|---|---|---|---|---|---|---|---|
mT5 (base) | 582M | 36.6/22.5 | 10.3 | 59.0/65.3 | 17.5 | 9.6 | 2.7/0.7 | 24.9 |
XLM-ProphetNet | 616M | 23.3/16.4 | 7.8 | 53.0/57.3 | 20.0 | 9.5 | 6.2/2.7 | 21.8 |
mBART-50 | 611M | 23.6/16.7 | 10.4 | 53.4/58.9 | 18.5 | 11.2 | 5.4/3.7 | 22.4 |
IndicBART | 244M | 22.7/13.1 | 8.1 | 53.3/58.8 | 14.8 | 7.9 | 6.3/2.5 | 20.8 |
BanglaT5 | 247M | 38.8/25.2 | 13.7 | 68.5/74.8 | 19.0 | 13.8 | 6.4/4.0 | 29.4 |
基準測試數據集如下:
- 機器翻譯 (MT): Machine Translation
- 抽象文本摘要 (TS): Abstractive Text Summarization
- 問答 (QA): Question Answering
- 多輪對話生成 (MD): Multi Turn Dialogue Generation
- 新聞標題生成 (NHG): News Headline Generation
- 跨語言摘要 (XLS): Cross-lingual Summarization
📄 許可證
本項目採用 cc-by-nc-sa-4.0
許可證。
📚 引用
如果你使用此模型,請引用以下論文:
@article{bhattacharjee2022banglanlg,
author = {Abhik Bhattacharjee and Tahmid Hasan and Wasi Uddin Ahmad and Rifat Shahriyar},
title = {BanglaNLG: Benchmarks and Resources for Evaluating Low-Resource Natural Language Generation in Bangla},
journal = {CoRR},
volume = {abs/2205.11081},
year = {2022},
url = {https://arxiv.org/abs/2205.11081},
eprinttype = {arXiv},
eprint = {2205.11081}
}
如果你使用了歸一化模塊,請引用以下論文:
@inproceedings{hasan-etal-2020-low,
title = "Not Low-Resource Anymore: Aligner Ensembling, Batch Filtering, and New Datasets for {B}engali-{E}nglish Machine Translation",
author = "Hasan, Tahmid and
Bhattacharjee, Abhik and
Samin, Kazi and
Hasan, Masum and
Basak, Madhusudan and
Rahman, M. Sohel and
Shahriyar, Rifat",
booktitle = "Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)",
month = nov,
year = "2020",
address = "Online",
publisher = "Association for Computational Linguistics",
url = "https://www.aclweb.org/anthology/2020.emnlp-main.207",
doi = "10.18653/v1/2020.emnlp-main.207",
pages = "2612--2623",
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.",
}
Phi 2 GGUF
其他
Phi-2是微軟開發的一個小型但強大的語言模型,具有27億參數,專注於高效推理和高質量文本生成。
大型語言模型 支持多種語言
P
TheBloke
41.5M
205
Roberta Large
MIT
基於掩碼語言建模目標預訓練的大型英語語言模型,採用改進的BERT訓練方法
大型語言模型 英語
R
FacebookAI
19.4M
212
Distilbert Base Uncased
Apache-2.0
DistilBERT是BERT基礎模型的蒸餾版本,在保持相近性能的同時更輕量高效,適用於序列分類、標記分類等自然語言處理任務。
大型語言模型 英語
D
distilbert
11.1M
669
Llama 3.1 8B Instruct GGUF
Meta Llama 3.1 8B Instruct 是一個多語言大語言模型,針對多語言對話用例進行了優化,在常見的行業基準測試中表現優異。
大型語言模型 英語
L
modularai
9.7M
4
Xlm Roberta Base
MIT
XLM-RoBERTa是基於100種語言的2.5TB過濾CommonCrawl數據預訓練的多語言模型,採用掩碼語言建模目標進行訓練。
大型語言模型 支持多種語言
X
FacebookAI
9.6M
664
Roberta Base
MIT
基於Transformer架構的英語預訓練模型,通過掩碼語言建模目標在海量文本上訓練,支持文本特徵提取和下游任務微調
大型語言模型 英語
R
FacebookAI
9.3M
488
Opt 125m
其他
OPT是由Meta AI發佈的開放預訓練Transformer語言模型套件,參數量從1.25億到1750億,旨在對標GPT-3系列性能,同時促進大規模語言模型的開放研究。
大型語言模型 英語
O
facebook
6.3M
198
1
基於transformers庫的預訓練模型,適用於多種NLP任務
大型語言模型
Transformers

1
unslothai
6.2M
1
Llama 3.1 8B Instruct
Llama 3.1是Meta推出的多語言大語言模型系列,包含8B、70B和405B參數規模,支持8種語言和代碼生成,優化了多語言對話場景。
大型語言模型
Transformers 支持多種語言

L
meta-llama
5.7M
3,898
T5 Base
Apache-2.0
T5基礎版是由Google開發的文本到文本轉換Transformer模型,參數規模2.2億,支持多語言NLP任務。
大型語言模型 支持多種語言
T
google-t5
5.4M
702
精選推薦AI模型
Llama 3 Typhoon V1.5x 8b Instruct
專為泰語設計的80億參數指令模型,性能媲美GPT-3.5-turbo,優化了應用場景、檢索增強生成、受限生成和推理任務
大型語言模型
Transformers 支持多種語言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一個基於SODA數據集訓練的超小型對話模型,專為邊緣設備推理設計,體積僅為Cosmo-3B模型的2%左右。
對話系統
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基於RoBERTa架構的中文抽取式問答模型,適用於從給定文本中提取答案的任務。
問答系統 中文
R
uer
2,694
98