Merged
Conversation
文字種境界(漢字→ひらがな/カタカナ)で分割される候補を、通常スコアが 閾値未満のときにフォールバックで救済する仕組みを追加。 - findSingleKanjiToKanaBoundary(): 遷移1回の漢字→かな境界を検出 - tryBoundaryFallback(): 姓側に辞書根拠がある場合のみ rescue - confidence 0.8 で返す(通常の 1.0 と区別) - 既存の辞書高信頼ケースには影響なし(MVP 94.7% 維持) Closes #6 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
辞書未ヒットの姓にひらがな/カタカナが含まれる場合に減点する。 日本人の苗字はほぼ漢字のみで構成されるため、 「宝鐘マ」のような漢字+かな混在の姓は不自然と判定できる。 - 漢字+カタカナ1文字末尾: -3.0 - 漢字+ひらがな1文字末尾: -2.5 - 漢字+かな2文字以上末尾: -1.5 - 辞書ヒットする姓には適用しない - BOUNDARY_AFTER_PENALTY を -1.2 → -1.8 に強化 VTuber名 [lowConf]: 3.3% → 93.3%(28/30正解) 既存精度への影響なし(MVP 94.7%、誤分割0%) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- findSingleScriptBoundary() で漢字→かな/かな→漢字の両方向を検出 - かな→漢字方向でも境界ボーナス/ペナルティが効くように - mei 側の混在ペナルティは除外(よね子、ルミ子等の自然な名前を保護) - かな姓+漢字名 [lowConf]: 56.3% → 87.5% - 名前内部にかな混在 [lowConf]: 100% 維持(リグレッションなし) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0.8 だと1文字姓の辞書ヒットが強すぎて、上白石萌音、柳樂優弥等で 正しい複数文字姓に勝ってしまうリグレッションが発生していた。 0.5 で松井珠理奈等の改善を維持しつつリグレッションを解消。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- カタカナ姓の例外フロー: 前半が全カタカナの場合、後半を姓辞書で照合 して一致すれば芸名パターンとして採用(confidence 0.8) 例: ジャガー/横田、ダン/池田、マイク/眞木 - SEI_HIT_BONUS: 0.8 → 0.5 に調整(1文字姓リグレッション防止) - ユニットテストを大幅拡充: - findSingleScriptBoundary の関数テスト - OOV姓混在ペナルティのテスト - 姓ヒットボーナスのテスト - カタカナ姓例外フローのテスト 84テスト全パス かな姓+漢字名 [lowConf]: 81.3% → 100% MVP [lowConf]: 99.5% (1 wrong: 池井戸潤) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ab06f03 to
a020453
Compare
Test Results
Unit Tests: 13 passed files, 84 passed tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
文字種境界(漢字↔かな)を活用したスコアリング改善。辞書未収録の名前でも文字種の切り替わりを手がかりに分離精度を向上。
1. 文字種境界スコアリング (
calcScoreに直接組み込み)2. OOV 姓の文字種混在ペナルティ
3. 姓ヒットボーナス (+0.5)
松井/珠理奈(sei=surface) vs松井珠/理奈(mei=surface) の逆転を防止4. カタカナ姓の例外フロー
ジャガー横田→ 「横田」が姓辞書ヒット → 採用 (confidence 0.8)Before / After
通常モードの誤分割: 全カテゴリ 0 件のまま
残り lowConf wrong (3件)
Closes #6
Test plan
🤖 Generated with Claude Code