-
Notifications
You must be signed in to change notification settings - Fork 0
/
caption.txt
1 lines (1 loc) · 6.69 KB
/
caption.txt
1
最近文字起こしを行うサービスに興味を持って色々調査して簡単なアプリケーションを作成してみたので共有したいと思います。アプリケーションの紹介に入る前に字幕に関して説明したいと思うんですけれども、字幕と日本語で表現しても厳密にはキャプションとサブタイトルの二種類が存在します。それは動画を作成する側が想定している視聴者によって使い分けが必要となります。まず、サブタイトルですけれども、こちらはネットフリックスとかアマゾンプライムなどで海外映画やドラマを見ていたりすると、下の方に表示される日本語字幕のイメージとなります。つまり母国語が異なる視聴者に向けた字幕のことを指します。次にキャプションですけれども、これは音声言語と同じ言語の字幕を表示することになります。つまり閲覧の対象者としては聴覚障害者が典型的かなと思います。キャプションにはさらにクローズドとオプションの二分類に分けることができてクローズドはユーザーの意思でオンとオフを切り替えることができる。オープンはビデオファイルに最初から埋め込まれていて常に表示されているものとなります。基本的にはユーザが自由に音を切り替えられた方がよいのでクローズドキャプションが推奨されています。下の方に書いておきましたがバラエティ番組とかユーチューブとかで表示されているテロップっていうのはこの文脈とは異なるものなので今回は取り扱いません。今回は複数言語の翻訳も行ないたいのでサブタイトルとクローズドキャプションを同時に生成することを目指します。次に動画という媒体に関して、私の認識をお話ししたいと思います。動画はyoutubeの隆盛を見れば言うまでもないですが、ユーザーを教育したり楽しませたりするというのに非常に効果的な方法媒体かなと思います。最近では学校の教育もE-Learning形式に移行しつつあるということもあって動画媒体のコンテンツ制作っていうのは今後も需要が高まっていくと思います。ただそんな動画にも弱点がいくつかあると思います。基本的には動画ではナレーションが主体でスライド内には必要最小限の情報を載せることがベストだと言われています。そのためスピーカーの話を最後まで聞いてみないことには全ての情報を理解することができません。また動画自体に小さな修正、例えば間違った単語を使ってしまっていたとか、言い忘れてしまっていたとか、そんなようなことがあった場合に動画を再度取り直したり編集する手間が掛かってしまいます。また基本的に音を聞いたりするよりも文字を読むほうが早いので、リスナーからすると文字媒体の方が情報アクセスは容易です。さらに文字媒体の書籍とは違って、索引が存在しないので動画から必要な情報を探すというのは非常に手間がかかります。これらの問題点の解決案としてクローズドキャプションがあるかと思います。このスライドにはクローズドキャプションのメリットをまとめておきましたが、先ほど言ったことの裏返しになるのでスライドでの説明は省きたいと思います。今回使用した、AWSサービスは文字起こしをする深層学習モデルであるAmazon Transcribeとなります。実は医学用語を理解できるようにトレーニングされているモデルも用意されていますが、現状は英語のみの対応となっています。次に一つの言語を他言語、複数言語に翻訳するための深層学習モデルであるAmazon Translateも使用しました。対応している言語は先程ドキュメントで見たところ、七十言語以上ありました。今回作成したプログラムのアーキテクチャを簡単に説明したいと思います。まずユーザはmp4形式のメディアファイルを用意します。そのファイルをPythonで構築されたアプリケーション中で読み込ませてAmazonTranscribe APIでリクエストを送信します。所定のS3と呼ばれるアマゾンクラウド上にあるファイルストレージサービスに文字起こし出たテキストをアウトプットします。アウトプットされたデータはVTTという字幕用フォーマットをされているテキストデータになるんですが、こちらをダウンロードします。今回は日本語の動画を使うので日本語の字幕ファイルが生成されるということになります。その後この字幕ファイルを他の言語に翻訳するためにAmazon Translate APIにリクエストをします。今回は英語と韓国語とスペイン語とドイツ語とポルトガル語とフランス語と中国語に一気に翻訳させようと思います。これらのジョブを実行することによって各言語ごとにファイルを作成します最後にオリジナルの動画ファイルとこれまでに取得していた字幕ファイルを、動画に埋め込みます。出力される動画ファイルはMKVファイルとなります。デモの映像は後編で作成しようかな?と考えています。ちなみにこの動画もキャプションと複数言語のサブタイトルを選べるようにしたいと思いますので試してみてください。自分は英語しかわからないのでもし他の言語分かる方がいたら正確かどうか見てみてください。このプログラムの問題点としては生成したサブタイトルっていうのが日本語の表示タイミングがベースとなっているので他言語で表示された際にはセンテンスが一瞬で消えてしまったりとか、逆になかなか表示されないタイミングが出たりとかという、タイミングに関係する問題がありますので、その辺のスピード感とかタイミングっていうのをバランスよく表示できるように単語の数っていうのを指定して再度カスタマイズしたりとか、まあそういった対応が必要かなと思いますが、それに関しては今後の課題とさせていただきたいと思います。発表は以上です。御清聴ありがとうございました。