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