-
Notifications
You must be signed in to change notification settings - Fork 308
Add realtime translation feature on Meeting Menutes Page #1199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@tbrand |
@@ -0,0 +1,110 @@ | |||
import { useMemo, useCallback, useState } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
このファイルの処理が既存の hooks/useOneshotTranslation.ts とだいぶ被っている気がするのですが、そちらは流用可能でしょうか?足りなければ、元ファイルのオプション増やしてもよいです!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
そうですね、既存の useOneshotTranslation.ts のオプションを増やしても難しいところがあって、useOneshotTranslation.ts と useRealtimeTranslate.ts は別ファイルがいいと思っています。ただ、共通ロジックを TranslationCore として共通化して、useOneshotTranslate.ts と useRealtimeTranslate.ts で実装の重複がないようにしてみます。後ほどレビュー対象の URL を張ります。
なお、以下の違いがあり別のファイルとして切り出すのがいいと考えています。
・モデルの選択肢の提供有無
useOneshotTranslate.ts は、Light モデルのうち一番最初のインデックス [0] を強制的に利用しているのに対して、useRealtimeTranslate.ts は、Light モデルを優先的にドロップダウンの上に表示しつつも、ユーザーに選択肢を提供している
・翻訳対象の違い
Oneshot のほうは、動画プロンプトをワンショットで翻訳することに対して、リアルタイム文字起こしは複数の文章 (Segment) を翻訳対象にしているので、複数の翻訳処理を受け取れるようにしている。
こんなイメージ
{
"segumentid-1": true, // 翻訳中
"segumentid-2": false, // 完了済み
"segumentid-3": true, // 翻訳中
}
・将来的に 5 秒ごとに翻訳することを想定
リアルタイム文字起こしの翻訳は、実際触ってみて思ったのですが、もうすこし早く翻訳したほうがユーザー体験がいいなと思っています。Bedrock のスロットリングが怖くて Segment ごとに翻訳していたんですが、Haiku などの light モデルを利用すれば、1 分あたり 2000 回のリクエストの Service Quota なので、そこまで懸念するほどではないのかなと思い始めています。
この Pull Request がマージされたあと、落ち着いたタイミングでの変更を考えており、use ファイルも 2 つに分割したほうが見通しがいいのかなと思っています。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,28 @@ | |||
// Common types for Meeting Minutes components | |||
|
|||
export type InputMethod = 'microphone' | 'direct' | 'file'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これは新しいディレクトリを切るまでもないことだと思うので、どこかに押し込めていただけると助かります!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正いたしました!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<ScreenAudioToggle | ||
enabled={enableScreenAudio} | ||
onToggle={setEnableScreenAudio} | ||
isSupported={isScreenAudioSupported} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noticeText がほしいです!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修正いたしました!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!!
Description of Changes
・議事録ページに、リアルタイム翻訳機能を追加しました。
・リアルタイム翻訳は、Transcribe の文節ごとに、翻訳を行う。リアルタイムというよりかは、準リアルタイムという表現が近い。5 秒ごとに翻訳みたいなことはできるが、コストを気にして、いったん文節ごとに翻訳を行うようにした。
・議事録用の Bedrock モデルと、リアルタイム翻訳用の Bedrock モデルは個別に指定が可能。リアルタイム翻訳用は、コスト面を考慮して、Claude 3.5 Haiku と Nova Pro を上位に表示。
・翻訳精度を上げるために、ユーザー定義のコンテキストと、システムが 1 分ごとにコンテキストと自動生成してくれる機能を実装
・リアルタイム翻訳は文字起こしの下に表示するため、画面を大きく利用するため、折り畳み機能を追加 (デフォルトは展開されていて、画面を大きく使いたいときに折り畳みが可能)
in English
・Added real-time translation functionality to the meeting minutes page.
・Real-time translation performs translation for each phrase segment from Transcribe. Rather than true real-time, it's more accurately described as near real-time. While translation every 5 seconds is possible, considering costs, we implemented translation on a per-phrase basis.
・The Bedrock model for meeting minutes and the Bedrock model for real-time translation can be specified separately. For real-time translation, Claude 3.5 Haiku and Nova Pro are displayed at the top considering cost factors.
・To improve translation accuracy, implemented user-defined context and a feature where the system automatically generates context every minute.
・Since real-time translation is displayed below the transcription and uses a large portion of the screen, added a collapsible feature (default is expanded, can be collapsed when wanting to use more screen space).
Checklist
npm run cdk:test
and if there are snapshot differences, executenpm run cdk:test:update-snapshot
to update snapshotsRelated Issues
None