🚀 WebOrganizer/TopicClassifier-NoURL
TopicClassifier-NoURLは、ウェブページのテキスト内容(URL情報を使用せず)に基づいて、ウェブコンテンツを17のカテゴリに分類します。
[論文] [ウェブサイト] [GitHub]
🚀 クイックスタート
TopicClassifier-NoURLは、ウェブページのテキスト内容に基づいて、ウェブコンテンツを17のカテゴリに分類します。このモデルは、140Mのパラメータを持つgte-base-en-v1.5を、以下のトレーニングデータでファインチューニングしたものです。
- WebOrganizer/TopicAnnotations-Llama-3.1-8B: Llama-3.1-8Bによってアノテーションされた100万件のドキュメント(第一段階のトレーニング)
- WebOrganizer/TopicAnnotations-Llama-3.1-405B-FP8: Llama-3.1-405B-FP8によってアノテーションされた10万件のドキュメント(第二段階のトレーニング)
全ドメイン分類器
💻 使用例
基本的な使用法
この分類器は、以下の形式の入力を期待します。
{text}
例:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("WebOrganizer/TopicClassifier-NoURL")
model = AutoModelForSequenceClassification.from_pretrained(
"WebOrganizer/TopicClassifier-NoURL",
trust_remote_code=True,
use_memory_efficient_attention=False)
web_page = """How to build a computer from scratch? Here are the components you need..."""
inputs = tokenizer([web_page], return_tensors="pt")
outputs = model(**inputs)
probs = outputs.logits.softmax(dim=-1)
print(probs.argmax(dim=-1))
モデルのlogits
をソフトマックス関数で変換することで、以下の24のカテゴリに関する確率分布を得ることができます(ラベルの順序で、モデルの設定にあるid2label
とlabel2id
も参照)。
- Adult
- Art & Design
- Software Dev.
- Crime & Law
- Education & Jobs
- Hardware
- Entertainment
- Social Life
- Fashion & Beauty
- Finance & Business
- Food & Dining
- Games
- Health
- History
- Home & Hobbies
- Industrial
- Literature
- Politics
- Religion
- Science & Tech.
- Software
- Sports & Fitness
- Transportation
- Travel
カテゴリの完全な定義は、taxonomy configに記載されています。
高度な使用法
効率的な推論のために、unpaddingとメモリ効率的なアテンションを有効にすることで、効率的なgte-base-en-v1.5の実装を使用することをお勧めします。これには、xformers
のインストールが必要です(詳細はこちらを参照)。モデルを以下のようにロードします。
AutoModelForSequenceClassification.from_pretrained(
"WebOrganizer/TopicClassifier-NoURL",
trust_remote_code=True,
unpad_inputs=True,
use_memory_efficient_attention=True,
torch_dtype=torch.bfloat16
)
📚 ドキュメント
引用
@article{wettig2025organize,
title={Organize the Web: Constructing Domains Enhances Pre-Training Data Curation},
author={Alexander Wettig and Kyle Lo and Sewon Min and Hannaneh Hajishirzi and Danqi Chen and Luca Soldaini},
journal={arXiv preprint arXiv:2502.10341},
year={2025}
}
📄 ライセンス
原文書にライセンス情報はありませんでした。