Skip to content

hayamimi 早耳 v0.2.0 — 言語切替を作り直しました / language switching, redesigned

Choose a tag to compare

@oboroge0 oboroge0 released this 27 Aug 05:03
· 94 commits to main since this release

言語切替の仕組みを大きく見直しました。ぜひ実際の環境で試してみてください。

言語切替を改善しました

v0.1.xまでの自動言語切替には、主に2つの問題がありました。

  • 最初の発話を誤判定すると、その後もしばらく間違った言語が使われ続ける
  • 相槌などの短い発話を別の言語と誤認し、意図せず切り替わる

実際にマイクを使ってテストする中でも、この両方のケースを確認していました。

v0.2.0では、言語判定に2つの判定器を使用し、両方の結果が一致した場合にのみ言語を切り替える方式へ変更しました。

検証では、短い発話に対する単独の判定器の正解率が約61%だったのに対し、2つの判定結果が一致したケースでは約98%まで向上しました。測定方法や詳細な結果は docs/LID.md にまとめています。

この変更により、言語が明確な発話では素早く切り替えつつ、相槌のような曖昧な短い発話では不要な切替が起きにくくなっています。

また、速報として表示される途中字幕で言語判定を誤った場合でも、その後に生成される確定字幕では再判定され、修正されるようになっています。

3つのモードから選べます

起動オプション 動作
--mode single --lang ja 指定した言語のみを使用します。自動切替は行いません
--mode balanced 新しい判定方式です。v0.2.0からの標準モードです
--mode fast 判定結果に応じてすぐに切り替える、従来に近い動作です

安定性を重視する場合は balanced、単一言語で使用する場合は single、切替速度を優先する場合は fast を選べます。

実際の環境で試してみてください

開発環境では、5言語を混在させた約12分の連続音声でも動作を確認しており、従来の即時切替方式と比べて意図しない言語切替が7回から3回に減ることを測定しています(docs/SOAK.md)。

とはいえ、言語切替の使いやすさは、話し方、声、マイク、周囲のノイズなどによって変わります。実際の配信や会議でどのように動くかを知りたいと考えています。

普段どおり使ってみて、

  • 切り替わってほしい場面で切り替わらなかった
  • 意図していない場面で言語が切り替わった

といったケースがあれば、使用していた言語やその時の状況とあわせてIssueで報告してもらえると助かります。

実際の使用例が増えるほど、今後の調整や改善に活かしやすくなります。

その他の変更

翻訳先として指定できる言語を拡張しました。

--translate es のように、M2M-100が対応する約100言語を指定できます。スペイン語については品質検証も行っています。

この変更のきっかけを作ってくれた @wheesnoza さん、そしてhayamimi初の外部コントリビューションをありがとうございました。#7

OBS向け字幕オーバーレイも改善しました。

確定した字幕と、現在話している途中の字幕を別々のソースとして配置できます。

  • ?show=final で確定字幕のみ表示
  • ?show=partial で途中字幕のみ表示

そのほか、以下を含む複数の不具合を修正しています。

  • 広東語へ正しく切り替わらない問題
  • 長時間話すと字幕が消えることがある問題

破壊的変更はありません。モデルの再ダウンロードも不要です。

English summary

Language switching has been redesigned in v0.2.0.

In v0.1.x, an incorrect decision on the first utterance could cause the wrong language to remain active, while short interjections could sometimes trigger unintended switches.

The new balanced mode uses two language detectors and switches only when their results agree. In our evaluation, a single detector achieved about 61% accuracy on short utterances, while cases where both detectors agreed were correct about 98% of the time. Details are available in docs/LID.md. In a 12-minute five-language soak test, unintended switches dropped from 7 (previous instant-switching behavior) to 3 (docs/SOAK.md).

Three modes are now available.

  • single keeps the language fixed
  • balanced uses the new agreement-based system and is now the default
  • fast prioritizes immediate switching and behaves similarly to the previous system

Please try it during real streams, meetings, or conversations. If the language switches unexpectedly, or fails to switch when it should, opening an Issue with the languages involved and some context would be very helpful.

--translate now also accepts roughly 100 target languages supported by M2M-100. Spanish has been validated. Thanks to @wheesnoza for the suggestion and for hayamimi's first external contribution in #7.

The OBS subtitle overlay can now show confirmed and in-progress subtitles as separate sources using ?show=final and ?show=partial.

There are no breaking changes, and no model downloads are required.

🤖 Generated with Claude Code