🚀 キーワード抽出モデル
このモデルは、Flan-T5 small モデルを微調整したもので、段落からキーワードを抽出するために特化しています。T5アーキテクチャの力を活用して、入力テキストの本質を捉えるキーフレーズを識別して出力します。
✨ 主な機能
このモデルは段落を入力として受け取り、テキストの主要なトピックやテーマを要約するキーワードまたはキーフレーズのリストを生成します。以下の用途に特に役立ちます:
- 長いテキストの要約
- 記事やブログ投稿のタグ生成
- 文書内の主要なテーマの特定
🚀 クイックスタート
想定される用途と制限
想定される用途:
- 長い段落の迅速な要約
- コンテンツ管理システムのメタデータ生成
- SEOキーワードの特定支援
制限事項:
- モデルは時々関連性のないキーワードを生成することがあります。
- パフォーマンスは入力テキストの長さと複雑さによって異なります。
- 最良の結果を得るには、長くクリーンなテキストを使用してください。
- Flan-T5アーキテクチャの制限により、長さの上限は512トークンです。
- このモデルは英語のテキストで学習されており、他の言語ではうまく機能しない可能性があります。
学習と評価
このモデルは、英語のウィキペディアの段落とそれに対応するキーワードのデータセットで微調整されました。様々なトピックが含まれており、幅広い適用性が保証されています。
📦 インストール
このモデルを使用するには、transformers
ライブラリが必要です。以下のコマンドでインストールできます:
pip install transformers
💻 使用例
基本的な使用法
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_name = "agentlans/flan-t5-small-keywords"
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
input_text = "Your paragraph here..."
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=512)
decoded_output = tokenizer.decode(outputs[0], skip_special_tokens=True)
keywords = list(set(decoded_output.split('||')))
print(keywords)
入力段落の例
In the heart of the bustling city, a hidden gem awaits discovery: a quaint little bookstore that seems to have escaped the relentless march of time. As you step inside, the scent of aged paper and rich coffee envelops you, creating an inviting atmosphere that beckons you to explore its shelves. Each corner is adorned with carefully curated collections, from classic literature to contemporary bestsellers, inviting readers of all tastes to lose themselves in the pages of a good book. The soft glow of warm lighting casts a cozy ambiance, while the gentle hum of conversation among fellow book lovers adds to the charm. This bookstore is not just a place to buy books; it's a sanctuary for those seeking solace, inspiration, and a sense of community in the fast-paced world outside.
出力キーワードの例
['old paper coffee scent', 'cosy hum of conversation', 'quaint bookstore', 'community in the fast-paced world', 'solace inspiration', 'curated collections']
🔧 技術詳細
制限とバイアス
このモデルは英語のウィキペディアの段落で学習されているため、バイアスが生じる可能性があります。ユーザーは、生成されるキーワードがこれらのバイアスを反映している可能性があることを認識し、出力を慎重に使用する必要があります。
学習の詳細
属性 |
详情 |
学習データ |
ウィキペディアの段落とキーワードのデータセット |
学習手順 |
google/flan-t5-smallの微調整 |
学習ハイパーパラメータ
学習中に以下のハイパーパラメータが使用されました:
- 学習率: 5e-05
- 学習バッチサイズ: 8
- 評価バッチサイズ: 8
- シード: 42
- オプティマイザ: Adam (betas=(0.9,0.999), epsilon=1e-08)
- 学習率スケジューラのタイプ: 線形
- エポック数: 10.0
フレームワークのバージョン
- Transformers 4.45.1
- Pytorch 2.4.1+cu121
- Datasets 3.0.1
- Tokenizers 0.20.0
📚 ドキュメント
倫理的な考慮事項
このモデルを使用する際には、自動キーワード抽出がコンテンツ作成やSEO手法に与える潜在的な影響を考慮してください。このモデルの使用が関連するガイドラインに準拠しており、誤解を招くまたはスパム的なコンテンツの作成に寄与しないことを確認してください。
📄 ライセンス
このモデルはMITライセンスの下で提供されています。