Downloads · 30 days
11
3% of all-time downloads
ACEEE1222/bart-large-chinese-LCSTS
bart-large-chinese-LCSTS is a summarization model from ACEEE1222. Use it when you need a shorter version of a longer text. It is set up for peft.
这是一个基于 fnlp/bart-large-chinese 模型进行 LoRA 微调的中文摘要模型,训练任务为中文新闻标题或摘要生成,适用于中文短文本压缩和提炼。
Downloads · 30 days
11
3% of all-time downloads
All-time downloads
357
Public
Repo size
4.7 MB
Likes
0
Public
Click a slice to open those files.
.safetensors4.7 MB · 78%
From the Hugging Face model README
这是一个基于 fnlp/bart-large-chinese 模型进行 LoRA 微调的中文摘要模型,训练任务为中文新闻标题或摘要生成,适用于中文短文本压缩和提炼。
本模型使用 PEFT 框架对 fnlp/bart-large-chinese 进行参数高效微调,采用了 LoRA(Low-Rank Adaptation)技术,仅调整注意力中的部分权重矩阵,使得训练过程更轻量。
可用于中文摘要任务,如新闻标题生成、内容压缩等。
不适用于多语言摘要、多文档总结或事实一致性要求极高的任务。
该模型基于公开中文数据集进行训练,可能在处理敏感内容、歧视性语言或特定社会群体时存在偏差。
建议仅在清洗干净的中文文本数据上使用该模型,避免用于决策支持或敏感领域。
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
from peft import PeftModel
base_model = AutoModelForSeq2SeqLM.from_pretrained("fnlp/bart-large-chinese")
peft_model = PeftModel.from_pretrained(base_model, "your-username/your-model-name")
tokenizer = AutoTokenizer.from_pretrained("fnlp/bart-large-chinese")
inputs = tokenizer("据报道,苹果将在下月发布新款iPhone。", return_tensors="pt")
summary_ids = peft_model.generate(**inputs, max_length=30)
print(tokenizer.decode(summary_ids[0], skip_special_tokens=True))
微调数据来自预处理后的中文新闻摘要数据集(如LCSTS),分为训练集与验证集,并使用了 datasets 库保存和加载。
max_source_length 和 max_target_lengthq_proj, v_proj使用与训练集相同来源的 held-out 验证集。
使用 ROUGE-1 / ROUGE-2 / ROUGE-L 评估自动摘要质量,中文评估按“字”或“词”颗粒度使用 jieba 分词。
示例结果:
| Metric | Score |
|---|---|
| ROUGE-1 | 0.35 |
| ROUGE-2 | 0.19 |
| ROUGE-L | 0.31 |