Downloads · 30 days
20
27% of all-time downloads
AtefAndrus/jmoji-t5-v4_focal_top50_20251224
jmoji-t5-v4_focal_top50_20251224 is a translation model from AtefAndrus. Use it when you need text moved from one language to another. It is set up for transformers. The card lists the license as mit.
日本語テキストから絵文字列を生成する翻訳モデルです。Focal Lossを適用し、精度最良(Jaccard 0.182)を達成しました。
Downloads · 30 days
20
27% of all-time downloads
All-time downloads
74
Public
Parameters
227M
908 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors908 MB · 100%
From the Hugging Face model README
日本語テキストから絵文字列を生成する翻訳モデルです。Focal Lossを適用し、精度最良(Jaccard 0.182)を達成しました。
SNS投稿やチャットメッセージに適切な絵文字を自動付与するタスクを想定しています。
from transformers import T5Tokenizer, T5ForConditionalGeneration
model_name = "AtefAndrus/jmoji-t5-v4_focal_top50_20251224"
tokenizer = T5Tokenizer.from_pretrained(model_name)
model = T5ForConditionalGeneration.from_pretrained(model_name)
text = "今日は楽しかった"
inputs = tokenizer(text, return_tensors="pt", max_length=128, truncation=True)
outputs = model.generate(
**inputs,
max_length=32,
do_sample=True,
temperature=0.7,
top_k=50,
top_p=0.95,
repetition_penalty=1.2, # 推奨: 過剰生成抑制
)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result) # 例: 😊 🎉 ✨
| Parameter | Value |
|---|---|
| Learning Rate | 3e-4 |
| Batch Size | 16 |
| Epochs | 50 (Early Stopping: 5) |
| Label Smoothing | 0.1 |
| Focal Loss | γ=2.0 |
| Warmup Steps | 150 |
| Hardware | NVIDIA A100-SXM4-40GB |
| Metric | Value |
|---|---|
| Jaccard Similarity | 0.182 |
| Micro F1 | 0.286 |
| Precision | 0.345 |
| Recall | 0.250 |
| Diversity (Non-Top5 Ratio) | 14% |
| Model | Jaccard | Diversity |
|---|---|---|
| v4_focal_top50 (this) | 0.182 | 14% |
| v4_top50 | 0.165 | 21% |
| v4_focal_top100 | 0.115 | 25% |
| v4_top100 | 0.120 | 21% |
過剰生成(同じ絵文字の繰り返し)を抑制するため、repetition_penalty=1.2の使用を推奨します。
@misc{jmoji2025,
author = {AtefAndrus},
title = {Jmoji: Japanese Text to Emoji Translation using Knowledge Distillation},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/AtefAndrus/jmoji-t5-v4_focal_top50_20251224}
}
MIT License