Text Classification
Transformers
Safetensors
PyTorch
Japanese
bert
japanese
reservation-intent
Eval Results (legacy)
Instructions to use nori3tsu/classify-reservation-intent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nori3tsu/classify-reservation-intent with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="nori3tsu/classify-reservation-intent")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("nori3tsu/classify-reservation-intent") model = AutoModelForSequenceClassification.from_pretrained("nori3tsu/classify-reservation-intent", device_map="auto") - Notebooks
- Google Colab
- Kaggle
予約意図分類モデル
このモデルは日本語テキストから「予約する」「予約しない」の意図を分類します。
モデル詳細
- ベースモデル: cl-tohoku/bert-base-japanese
- タスク: テキスト分類(二項分類)
- 言語: 日本語
- ライブラリ: transformers
- フレームワーク: PyTorch
ラベル
LABEL_0: 予約するLABEL_1: 予約しない
使用方法
🚀 Interface API(推奨)
import requests
API_URL = "https://api-inference.huggingface.co/models/nori3tsu/classify-reservation-intent"
headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}
def query(payload):
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
# 使用例
result = query({"inputs": "はい、予約をお願いします"})
print(result)
# [{'label': 'LABEL_0', 'score': 0.95}]
🔧 Transformersライブラリ
from transformers import pipeline
# パイプライン作成
classifier = pipeline(
"text-classification",
model="nori3tsu/classify-reservation-intent"
)
# 推論実行
result = classifier("はい、予約をお願いします")
print(result)
# [{'label': 'LABEL_0', 'score': 0.95}]
📚 手動読み込み
from transformers import BertForSequenceClassification, BertJapaneseTokenizer
import torch
# モデルとトークナイザーの読み込み
model = BertForSequenceClassification.from_pretrained("nori3tsu/classify-reservation-intent")
tokenizer = BertJapaneseTokenizer.from_pretrained("nori3tsu/classify-reservation-intent")
# テキスト分類
text = "予約をお願いします"
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.softmax(outputs.logits, dim=1)
predicted_label = torch.argmax(predictions, dim=1).item()
print(f"予測ラベル: {predicted_label}")
print(f"確率分布: {predictions[0].tolist()}")
モデル性能
このモデルは予約意図の分類において高い精度を示します:
- 精度: 85%(推定)
- 対象ドメイン: 予約関連の日本語テキスト
- 推論速度: ~100ms(Interface API)
制限事項
- 日本語テキストのみサポート
- ドメイン特化モデル(予約関連の文脈で最適化)
- 短いテキスト(512トークン以下)での使用を推奨
ライセンス
Apache 2.0
引用
@misc{reservation-intent-classifier,
title={Japanese Reservation Intent Classification Model},
author={nori3tsu},
year={2024},
url={https://huggingface.co/nori3tsu/classify-reservation-intent}
}
- Downloads last month
- 19
Model tree for nori3tsu/classify-reservation-intent
Base model
tohoku-nlp/bert-base-japaneseEvaluation results
- Accuracy on Reservation Intent Classificationself-reported0.850