Banglat5 Small
基于序列到序列Transformer架构的孟加拉语预训练模型,专为自然语言生成任务优化
下载量 510
发布时间 : 2/9/2023
模型简介
这是一个针对孟加拉语优化的T5模型,通过Span Corruption目标进行预训练,适用于多种自然语言生成任务
模型特点
多任务适应能力
模型设计支持多种NLG任务,包括机器翻译、文本摘要和问答系统
优化的预处理管道
使用专门的文本归一化方法预处理数据,确保最佳性能
小规模高效架构
相比同类模型参数更少但性能优越,适合资源有限的环境
模型能力
机器翻译
抽象文本摘要
问答系统
多轮对话生成
新闻标题生成
跨语言摘要
使用案例
文本转换
孟加拉语-英语机器翻译
将孟加拉语文本翻译为英语
SacreBLEU得分38.8/25.2
文本摘要
新闻文章摘要
生成孟加拉语新闻文章的简短摘要
ROUGE-2得分13.7
问答系统
开放领域问答
回答基于孟加拉语文本的问题
EM/F1得分68.5/74.8
🚀 孟加拉语T5模型(BanglaT5)
本仓库包含了孟加拉语T5模型(小版本) 的预训练检查点。这是一个基于序列到序列的Transformer模型,通过"Span Corruption"目标进行预训练。使用此检查点进行微调的模型在许多孟加拉语自然语言生成(NLG)任务中取得了最先进的成果。
该模型可用于不同的下游任务,如机器翻译
、抽象文本摘要
、问答系统
等。若要进行微调,请参考官方GitHub 仓库 中的脚本。
⚠️ 重要提示
该模型使用了特定的归一化管道进行预训练,可在 此处 获取。官方GitHub仓库中的所有微调脚本默认使用此归一化方法。如果需要将预训练模型应用于其他任务,请确保在分词前使用此管道对文本单元进行归一化,以获得最佳效果。下面给出一个基本示例。
🚀 快速开始
✨ 主要特性
- 基于序列到序列的Transformer架构,适用于多种孟加拉语NLG任务。
- 预训练模型在多个NLG任务中达到了最先进的性能。
📦 安装指南
在使用该模型之前,你需要安装必要的库。可以使用以下命令安装归一化库:
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_small")
tokenizer = AutoTokenizer.from_pretrained("csebuetnlp/banglat5_small", 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)
📚 详细文档
🔍 基准测试
以下是模型在监督微调下的基准测试结果:
模型 | 参数数量 | 机器翻译(SacreBLEU) | 文本摘要(ROUGE - 2) | 问答系统(EM/F1) | 多轮对话生成(SacreBLEU - 1) | 新闻标题生成(ROUGE - 2) | 跨语言摘要(ROUGE - 2) | BNLG分数 |
---|---|---|---|---|---|---|---|---|
mT5 (base) | 5.82亿 | 36.6/22.5 | 10.3 | 59.0/65.3 | 17.5 | 9.6 | 2.7/0.7 | 24.9 |
XLM - ProphetNet | 6.16亿 | 23.3/16.4 | 7.8 | 53.0/57.3 | 20.0 | 9.5 | 6.2/2.7 | 21.8 |
mBART - 50 | 6.11亿 | 23.6/16.7 | 10.4 | 53.4/58.9 | 18.5 | 11.2 | 5.4/3.7 | 22.4 |
IndicBART | 2.44亿 | 22.7/13.1 | 8.1 | 53.3/58.8 | 14.8 | 7.9 | 6.3/2.5 | 20.8 |
BanglaT5 | 2.47亿 | 38.8/25.2 | 13.7 | 68.5/74.8 | 19.0 | 13.8 | 6.4/4.0 | 29.4 |
基准测试数据集如下:
📄 许可证
本项目采用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