This model classifies emails commonly exchanged in Japan's IT staffing industry with high accuracy, enabling automated email routing and workflow optimization.
1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="naoki-hosokawa/ses-mail-classifier-bert-japanese"
6)
7
8# Project email example
9result = classifier("【案件】Java開発 60万〜80万 渋谷 即日〜長期 面談1回")
10print(result)
11# [{'label': '案件', 'score': 0.98}]
12
13# Talent email example
14result = classifier("【ご紹介】Javaエンジニア 40代男性 都内在住 即日稼働可能 希望単価55万")
15print(result)
16# [{'label': '要員', 'score': 0.95}]
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model_name = "naoki-hosokawa/ses-mail-classifier-bert-japanese"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6model = AutoModelForSequenceClassification.from_pretrained(model_name)
7
8text = "【案件】Python開発 リモート可 50万〜"
9inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
10
11with torch.no_grad():
12 outputs = model(**inputs)
13 predictions = torch.softmax(outputs.logits, dim=-1)
14
15labels = ["案件", "要員", "その他"]
16predicted_label = labels[predictions.argmax().item()]
17confidence = predictions.max().item()
18
19print(f"Classification: {predicted_label} (Confidence: {confidence:.2%})")
1from transformers import pipeline
2
3classifier = pipeline(
4 "text-classification",
5 model="naoki-hosokawa/ses-mail-classifier-bert-japanese",
6 device=0 # Use GPU
7)
8
9emails = [
10 "【案件】AWS構築 フルリモート 55万〜",
11 "【ご紹介】クラウドエンジニア 経験5年",
12 "明日の会議は15時からでお願いします",
13]
14
15results = classifier(emails, batch_size=32)
16for email, result in zip(emails, results):
17 print(f"{result['label']}: {email[:30]}...")
This model follows the license of the base model
tohoku-nlp/bert-base-japanese-v3.