🚀 大飛鳥飛馬模型(大尺寸)
大飛鳥飛馬模型是基於稀疏注意力機制的Transformer模型,它將基於Transformer的模型(如BERT)擴展到更長的序列處理。此外,大飛鳥模型還從理論上闡釋了稀疏模型所能處理的完整Transformer的能力。
🚀 快速開始
大飛鳥模型依賴於塊稀疏注意力機制,而非普通的注意力機制(如BERT的注意力機制),與BERT相比,它能夠以更低的計算成本處理長度達4096的序列。該模型在各種涉及長序列的任務中取得了最優結果,例如長文檔摘要、長上下文問答等。
✨ 主要特性
- 基於塊稀疏注意力機制,可處理長序列。
- 計算成本相較於BERT更低。
- 在長文檔摘要、長上下文問答等任務中達到了最優效果。
📦 安裝指南
文檔未提及安裝步驟,故跳過此章節。
💻 使用示例
基礎用法
from transformers import BigBirdPegasusForConditionalGeneration, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("google/bigbird-pegasus-large-pubmed")
model = BigBirdPegasusForConditionalGeneration.from_pretrained("google/bigbird-pegasus-large-pubmed")
model = BigBirdPegasusForConditionalGeneration.from_pretrained("google/bigbird-pegasus-large-pubmed", attention_type="original_full")
model = BigBirdPegasusForConditionalGeneration.from_pretrained("google/bigbird-pegasus-large-pubmed", block_size=16, num_random_blocks=2)
text = "Replace me by any text you'd like."
inputs = tokenizer(text, return_tensors='pt')
prediction = model.generate(**inputs)
prediction = tokenizer.batch_decode(prediction)
📚 詳細文檔
模型描述
大飛鳥模型依賴於塊稀疏注意力機制,而非普通的注意力機制(即BERT的注意力機制),與BERT相比,它能夠以更低的計算成本處理長度達4096的序列。該模型在各種涉及長序列的任務中取得了最優結果,例如長文檔摘要、長上下文問答等。
訓練過程
此檢查點是在 科學論文 中的 pubmed數據集 上對 BigBirdPegasusForConditionalGeneration
進行 摘要任務 微調後得到的。
引用信息
@misc{zaheer2021big,
title={Big Bird: Transformers for Longer Sequences},
author={Manzil Zaheer and Guru Guruganesh and Avinava Dubey and Joshua Ainslie and Chris Alberti and Santiago Ontanon and Philip Pham and Anirudh Ravula and Qifan Wang and Li Yang and Amr Ahmed},
year={2021},
eprint={2007.14062},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
數據集和指標
屬性 |
詳情 |
模型類型 |
大飛鳥飛馬模型(大尺寸) |
訓練數據 |
來自科學論文數據集的pubmed數據集 |
任務類型 |
摘要任務 |
評估數據集 |
scientific_papers(pubmed和arxiv配置) |
ROUGE - 1(pubmed) |
40.8966 |
ROUGE - 2(pubmed) |
18.1161 |
ROUGE - L(pubmed) |
26.1743 |
ROUGE - LSUM(pubmed) |
34.2773 |
損失(pubmed) |
2.1707184314727783 |
流星指標(pubmed) |
0.3513 |
生成長度(pubmed) |
221.2531 |
ROUGE - 1(arxiv) |
40.3815 |
ROUGE - 2(arxiv) |
14.374 |
ROUGE - L(arxiv) |
23.4773 |
ROUGE - LSUM(arxiv) |
33.772 |
損失(arxiv) |
3.235051393508911 |
生成長度(arxiv) |
186.2003 |
📄 許可證
本項目採用Apache - 2.0許可證。