🚀 bart-finetuned-samsum 模型
本模型是专门对 facebook/bart-large-xsum 进行适配的版本,通过使用 SamSum 数据集进行微调,以提升其在对话摘要任务上的性能。
🚀 快速开始
本模型可用于对话摘要任务。以下是使用示例:
from transformers import pipeline
model = pipeline("summarization", model="luisotorres/bart-finetuned-samsum")
conversation = '''Sarah: Do you think it's a good idea to invest in Bitcoin?
Emily: I'm skeptical. The market is very volatile, and you could lose money.
Sarah: True. But there's also a high upside, right?
'''
model(conversation)
✨ 主要特性
- 基于 facebook/bart-large-xsum 模型进行微调。
- 针对 SamSum 数据集优化,在对话摘要任务上表现出色。
📦 安装指南
文档未提及安装步骤,可参考 transformers
库的官方安装指南进行安装。
💻 使用示例
基础用法
from transformers import pipeline
model = pipeline("summarization", model="luisotorres/bart-finetuned-samsum")
conversation = '''Sarah: Do you think it's a good idea to invest in Bitcoin?
Emily: I'm skeptical. The market is very volatile, and you could lose money.
Sarah: True. But there's also a high upside, right?
'''
model(conversation)
📚 详细文档
开发相关
训练参数
evaluation_strategy = "epoch",
save_strategy = 'epoch',
load_best_model_at_end = True,
metric_for_best_model = 'eval_loss',
seed = 42,
learning_rate=2e-5,
per_device_train_batch_size=4,
per_device_eval_batch_size=4,
gradient_accumulation_steps=2,
weight_decay=0.01,
save_total_limit=2,
num_train_epochs=4,
predict_with_generate=True,
fp16=True,
report_to="none"
参考资料
本模型基于原始的 BART 架构,详情可参考:
Lewis et al. (2019). BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension. arXiv:1910.13461
🔧 技术细节
本模型是对 facebook/bart-large-xsum 进行微调得到的,使用 SamSum 数据集进行训练,以提升在对话摘要任务上的性能。训练过程中使用了一系列的训练参数,如学习率、批次大小等,以优化模型的性能。
📄 许可证
文档未提及许可证信息。
📋 模型信息
属性 |
详情 |
模型类型 |
用于对话摘要的微调模型 |
训练数据 |
SamSum 数据集 |
评估指标 |
ROUGE-1、ROUGE-2、ROUGE-L、ROUGE-L Sum |
评估结果
数据集 |
ROUGE-1 |
ROUGE-2 |
ROUGE-L |
ROUGE-L Sum |
验证集 |
53.8804 |
29.2329 |
44.774 |
49.8255 |
测试集 |
52.8156 |
28.1259 |
43.7147 |
48.5712 |
示例输入
- John 和 Dan 讨论是否值得购买 PlayStation 5。
- Sarah 和 Emily 讨论投资比特币是否是个好主意。
- Madison 询问 Lawrence 文章是否完成。