T5 Finetuned Test
模型简介
该模型专门用于生成维基指南类文章的摘要,采用序列到序列架构,适用于英文文本的自动化摘要任务。
模型特点
高效摘要生成
针对维基指南类内容优化的摘要生成能力
轻量级架构
采用T5-small架构,在保持性能的同时降低计算资源需求
专业领域适配
专门在维基指南数据集上微调,适合操作指南类文本
模型能力
文本摘要生成
英文文本处理
序列到序列转换
使用案例
内容摘要
维基指南文章摘要
自动生成维基指南文章的简明摘要
Rouge1分数31.2,RougeL分数24.5
内容简化
操作指南简化
将复杂的操作步骤简化为关键要点
🚀 维基指南T5小模型
这是一个基于T5小模型架构,在维基指南(Wikihow)全数据集上训练的模型。它可以有效对文本进行摘要处理,帮助用户快速获取关键信息。
✨ 主要特性
- 标签信息:该模型与多个标签相关,包括wikihow、t5 - small、pytorch、lm - head、seq2seq、t5、pipeline:summarization、summarization等,表明其在文本摘要领域的专业性和适用性。
- 数据集:使用Wikihow数据集进行训练,该数据集涵盖丰富的知识和多样的文本类型,使得模型具有广泛的适用性。
- 评估指标:模型在Rouge1指标上得分为31.2,RougeL指标上得分为24.5,显示出较好的摘要生成效果。
📦 安装指南
暂未提供相关安装步骤,若有需要可根据模型使用的框架(如transformers库)进行常规安装。
💻 使用示例
基础用法
from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained("deep-learning-analytics/wikihow-t5-small")
model = AutoModelWithLMHead.from_pretrained("deep-learning-analytics/wikihow-t5-small")
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model = model.to(device)
text = """
Lack of fluids can lead to dry mouth, which is a leading cause of bad breath. Water
can also dilute any chemicals in your mouth or gut that are causing bad breath., Studies show that
eating 6 ounces of yogurt a day reduces the level of odor-causing compounds in the mouth. In
particular, look for yogurt containing the active bacteria Streptococcus thermophilus or
Lactobacillus bulgaricus., The abrasive nature of fibrous fruits and vegetables helps to clean
teeth, while the vitamins, antioxidants, and acids they contain improve dental health.Foods that can
be particularly helpful include:Apples — Apples contain vitamin C, which is necessary for health
gums, as well as malic acid, which helps to whiten teeth.Carrots — Carrots are rich in vitamin A,
which strengthens tooth enamel.Celery — Chewing celery produces a lot of saliva, which helps to
neutralize bacteria that cause bad breath.Pineapples — Pineapples contain bromelain, an enzyme that
cleans the mouth., These teas have been shown to kill the bacteria that cause bad breath and
plaque., An upset stomach can lead to burping, which contributes to bad breath. Don’t eat foods that
upset your stomach, or if you do, use antacids. If you are lactose intolerant, try lactase tablets.,
They can all cause bad breath. If you do eat them, bring sugar-free gum or a toothbrush and
toothpaste to freshen your mouth afterwards., Diets low in carbohydrates lead to ketosis — a state
in which the body burns primarily fat instead of carbohydrates for energy. This may be good for your
waistline, but it also produces chemicals called ketones, which contribute to bad breath.To stop the
problem, you must change your diet. Or, you can combat the smell in one of these ways:Drink lots of
water to dilute the ketones.Chew sugarless gum or suck on sugarless mints.Chew mint leaves.
"""
preprocess_text = text.strip().replace("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\", "")
tokenized_text = tokenizer.encode(preprocess_text, return_tensors="pt").to(device)
summary_ids = model.generate(
tokenized_text,
max_length=150,
num_beams=2,
repetition_penalty=2.5,
length_penalty=1.0,
early_stopping=True
)
output = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print("Summarized text: ", output)
高级用法
# 这里可根据具体需求调整生成摘要的参数,如改变max_length、num_beams等,以满足不同的摘要长度和质量要求。
# 例如,增加max_length可以得到更长的摘要,调整num_beams可以优化搜索策略。
# 以下是一个调整参数的示例:
from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained("deep-learning-analytics/wikihow-t5-small")
model = AutoModelWithLMHead.from_pretrained("deep-learning-analytics/wikihow-t5-small")
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model = model.to(device)
text = """
Bring 1/2 cup water to the boil.Add the fresh or dried rosemary to the water.Remove
from the heat. Set aside for 1/2 an hour to infuse. Added flavour can be released by pressing down
on the rosemary leaves with a spoon. Add the pieces to the blender or food processor with the
elderflower cordial. Blend or process to a purée.,, Add the lemon or lime juice and stir to
combine., Add a cover and place in the freezer.After 2 hours, remove from the freezer and break up
with a fork. This helps the ice crystals to form properly.Continue doing this every hour until the
granita freezes properly. Scoop the granita into dessert bowls and serve. Garnish with a cucumber
curl or a small sprig of rosemary.
"""
preprocess_text = text.strip().replace("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\", "")
tokenized_text = tokenizer.encode(preprocess_text, return_tensors="pt").to(device)
# 调整参数
summary_ids = model.generate(
tokenized_text,
max_length=200, # 增加最大长度
num_beams=4, # 增加束搜索的束数
repetition_penalty=3.0,
length_penalty=1.2,
early_stopping=True
)
output = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print("Summarized text: ", output)
📚 详细文档
该模型是在Wikihow全数据集上进行训练的T5小模型。训练过程持续了3个轮次,使用的批量大小为16,学习率为3e - 4。最大输入长度设置为512,最大输出长度为150。你可以参考此博客文章了解详细的训练过程。
🔧 技术细节
该模型基于T5小模型架构,在Wikihow数据集上进行微调。训练过程中,使用了特定的批量大小和学习率,以优化模型的性能。通过设置最大输入和输出长度,确保模型能够处理合适长度的文本并生成合理的摘要。在评估方面,采用了Rouge1和RougeL指标来衡量模型的摘要质量,最终模型在Rouge1指标上达到31.2分,RougeL指标上达到24.5分。
📄 许可证
暂未提供相关许可证信息。
Bart Large Cnn
MIT
基于英语语料预训练的BART模型,专门针对CNN每日邮报数据集进行微调,适用于文本摘要任务
文本生成 英语
B
facebook
3.8M
1,364
Parrot Paraphraser On T5
Parrot是一个基于T5的释义框架,专为加速训练自然语言理解(NLU)模型而设计,通过生成高质量释义实现数据增强。
文本生成
Transformers

P
prithivida
910.07k
152
Distilbart Cnn 12 6
Apache-2.0
DistilBART是BART模型的蒸馏版本,专门针对文本摘要任务进行了优化,在保持较高性能的同时显著提升了推理速度。
文本生成 英语
D
sshleifer
783.96k
278
T5 Base Summarization Claim Extractor
基于T5架构的模型,专门用于从摘要文本中提取原子声明,是摘要事实性评估流程的关键组件。
文本生成
Transformers 英语

T
Babelscape
666.36k
9
Unieval Sum
UniEval是一个统一的多维评估器,用于自然语言生成任务的自动评估,支持多个可解释维度的评估。
文本生成
Transformers

U
MingZhong
318.08k
3
Pegasus Paraphrase
Apache-2.0
基于PEGASUS架构微调的文本复述模型,能够生成语义相同但表达不同的句子。
文本生成
Transformers 英语

P
tuner007
209.03k
185
T5 Base Korean Summarization
这是一个基于T5架构的韩语文本摘要模型,专为韩语文本摘要任务设计,通过微调paust/pko-t5-base模型在多个韩语数据集上训练而成。
文本生成
Transformers 韩语

T
eenzeenee
148.32k
25
Pegasus Xsum
PEGASUS是一种基于Transformer的预训练模型,专门用于抽象文本摘要任务。
文本生成 英语
P
google
144.72k
198
Bart Large Cnn Samsum
MIT
基于BART-large架构的对话摘要模型,专为SAMSum语料库微调,适用于生成对话摘要。
文本生成
Transformers 英语

B
philschmid
141.28k
258
Kobart Summarization
MIT
基于KoBART架构的韩语文本摘要模型,能够生成韩语新闻文章的简洁摘要。
文本生成
Transformers 韩语

K
gogamza
119.18k
12
精选推荐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