name-split — 日本語人名の姓名分割エンドポイント
POST /api/v1/text/name-split
日本語人名(例: 「吉川良介」)を family / given に分割。
IPAdic 人名タグ + 空白 + 長さ heuristic の 5 戦略 fallback。
confidence (0-1) と warning を AI agent ergonomics として同梱。
エンドポイント
POST https://shirabe.dev/api/v1/text/name-split
X-API-Key: shrb_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (省略可、匿名 Free 枠 10,000 回/月)
Content-Type: application/json
リクエスト / Request
{
"name": "吉川良介"
}
name(string, required): 分割対象の日本語人名
レスポンス / Response
{
"name": "吉川良介",
"family": "吉川",
"given": "良介",
"confidence": 0.97,
"matched_by": "dictionary_both",
"timing": { "tokenize_ms": 4, "setup_ms": 187, "cold_start": true, "...": "..." },
"attribution": {
"dictionary": "IPAdic v3.0.7",
"license": "BSD 3-Clause",
"source": "https://github.com/lindera/lindera",
"notes": "IPAdic only MVP. Accuracy: well-known names 80-90%, ordinary 50-70%, rare 10-30%. JMnedict integration planned for monorepo phase (June 2026) to improve coverage."
}
}
confidence < 0.5 時は warning: "low_confidence" 同梱、
空入力時は warning: "empty_input"。
5 判定戦略 / 5 matching strategies
| matched_by | 条件 | confidence | 例 |
|---|---|---|---|
dictionary_both |
隣接する 姓+名 タグペア | 0.97 | 吉川 (姓) + 良介 (名) → 吉川 / 良介 |
dictionary_family_only |
姓 タグのみ + 後続 token を given 扱い | 0.7 | 山田 (姓) + 獏 (unknown) → 山田 / 獏 |
dictionary_given_only |
名 タグのみ + 先行 token を family 扱い | 0.7 | 珍奇 (unknown) + 良介 (名) → 珍奇 / 良介 |
whitespace |
空白区切り 2 セグメント | 0.6 | "珍奇 変人" → 珍奇 / 変人 |
heuristic |
長さベース split: 2 文字 = 1+1、3 文字 = 2+1、4 文字以上 = 2+残 | 0.4 + warning | "珍奇変人" → 珍奇 / 変人 |
confidence < 0.5 で warning: "low_confidence" 同梱、
AI agent は warning の有無で「再確認が必要な人名」を即判定可能。
コード例 / Code examples
curl
curl -X POST https://shirabe.dev/api/v1/text/name-split \
-H "Content-Type: application/json" \
-d '{"name": "吉川良介"}'
TypeScript(警告チェック)
const res = await fetch("https://shirabe.dev/api/v1/text/name-split", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": process.env.SHIRABE_API_KEY!,
},
body: JSON.stringify({ name: "吉川良介" }),
});
const result = await res.json();
if (result.warning === "low_confidence") {
console.warn(`分割信頼度低: ${result.name} → ${result.family}/${result.given} (${result.confidence})`);
} else {
console.log(`姓: ${result.family}, 名: ${result.given}`);
}
// → 姓: 吉川, 名: 良介
Python(バッチ処理)
import os, requests
names = ["吉川良介", "山田太郎", "佐藤健", "未知奇人"]
for n in names:
r = requests.post(
"https://shirabe.dev/api/v1/text/name-split",
json={"name": n},
headers={"X-API-Key": os.environ["SHIRABE_API_KEY"]},
timeout=10,
)
d = r.json()
flag = "⚠️" if d.get("warning") == "low_confidence" else "✓"
print(f"{flag} {n} → {d['family']} / {d['given']} ({d['confidence']:.2f}, {d['matched_by']})")
精度 / Accuracy
- 著名人 / 一般的な姓名: 80-90%(IPAdic 人名タグ hit、confidence 0.97)
- 一般的でない姓名: 50-70%(片方タグ hit + 反対側 fallback、confidence 0.7)
- 稀有 / 外国人名: 10-30%(タグなし、heuristic fallback、confidence 0.4 + warning)
AI agent には warning + confidence で「人手確認が必要かどうか」を判定させる運用が安全。
確実性が要求される業務(金融 KYC、行政申請等)では confidence ≥ 0.9 を閾値とすることを推奨。
レート制限 / Rate limit
全エンドポイント均一(料金プラン): Free 月 10,000 回 / 1 req/s、Starter 月 50 万回 / 30 req/s、Pro 月 500 万回 / 100 req/s、 Enterprise 無制限 / 500 req/s。
AI エージェント統合
OpenAPI 3.1 仕様で operationId: splitName。AI agent が name-split を呼ぶと
confidence + warning が response に含まれるため、「自動処理 vs 人手確認」の判定が
AI agent 側で完結できる(post-hoc の error handling 不要)。
更新履歴 / Updates
2026-05-09: name-split + name-reading IPAdic only MVP 実装完了
Option C(ハイブリッド)経営判断確定により、5/18 リリース時は IPAdic only MVP で投入、 2026-06 のモノレポ化時に JMnedict user dictionary 統合で精度底上げ (PR #5、 scoping 5/13-5/18 比 +4 日先行)。
2026-05-18: 正式リリース予定
本番 routes 活性化、Free 枠で利用開始。1+ 年変更なし約束。
2026-06: JMnedict 統合(計画)
SudachiDict と同じ self-contained 経路(offline build + R2 配信)で JMnedict 派生マップを生成、 人名タグなしのケースで matched_by を強化。精度向上は unilateral good news (Free 枠拡張・値下げと同様、課金プラン変更なし、既存呼出に破壊的影響なし)。
4 AI 観測の独自データ / Observed Multi-AI Landscape
Shirabe では 4 大 AI に同じ人名クエリを投げる独自測定を継続実施しています。
AI が自前で姓名分割を行うとフォーマット・粒度が分裂しますが、name-split なら
全 AI で同一の {family, given, confidence, matched_by, warning} 構造が返り、
下流処理を統一できます。
詳細は llms-full.txt を参照。