🚀 關鍵詞標題生成器
標題生成器是一款在線工具,它能幫助你為內容創建出色的標題。只需輸入特定的關鍵詞或有關內容的信息,你就能獲得主題建議,從而提升內容的吸引力。該工具由 https://exnrt.com 開發。
🚀 快速開始
主要特性
- 微調模型:T5-Base
- 參數數量:2.23 億
- 訓練數據集長度:10,000
- 驗證數據集長度:2,000
- 批次大小:1
- 訓練輪數:2
- 訓練損失:1.6578
- 驗證損失:1.8115
你還可以使用位於 mini 文件夾中的 t5-small
(7700 萬參數)模型。
安裝指南
文檔未提及安裝步驟,故跳過此部分。
💻 使用示例
基礎用法
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
tokenizer = AutoTokenizer.from_pretrained("Ateeqq/keywords-title-generator")
model = AutoModelForSeq2SeqLM.from_pretrained("Ateeqq/keywords-title-generator").to(device)
def generate_title(keywords):
input_ids = tokenizer(keywords, return_tensors="pt", padding="longest", truncation=True, max_length=24).input_ids.to(device)
outputs = model.generate(
input_ids,
num_beams=5,
num_beam_groups=5,
num_return_sequences=5,
repetition_penalty=10.0,
diversity_penalty=3.0,
no_repeat_ngram_size=2,
temperature=0.7,
max_length=24
)
return tokenizer.batch_decode(outputs, skip_special_tokens=True)
keywords = 'model, Fine-tuning, Machine Learning'
generate_title(keywords)
輸出示例
['How to Fine-tune Your Machine Learning Model for Better Performance',
'Fine-tuning your Machine Learning model with a simple technique',
'Using fine tuning to fine-tune your machine learning model',
'Machine Learning: Fine-tuning your model to fit the needs of machine learning',
'The Art of Fine-Tuning Your Machine Learning Model']
🔧 技術細節
文檔未提供足夠詳細的技術實現細節,故跳過此部分。
📄 許可證
本項目採用 Apache-2.0 許可證。
信息表格
屬性 |
詳情 |
模型類型 |
文本到文本生成 |
微調模型 |
T5-Base |
參數數量 |
2.23 億 |
訓練數據集長度 |
10,000 |
驗證數據集長度 |
2,000 |
批次大小 |
1 |
訓練輪數 |
2 |
訓練損失 |
1.6578 |
驗證損失 |
1.8115 |
替代模型 |
t5-small (7700 萬參數,位於 mini 文件夾) |