Microsoft Cognitive Services の
Translatorを個人的にまとめてみました。
2017-1-27
Cogbot #4session version
@BEACH_SIDE
横浜 篤よこはま あつし
http://beachside.hatenablog.com/
Using…
C#, ASP.NET, Azure, Machine Learning, Xamarin ….
所属の会社では、開発者募集しています♪
I’m a C#er.
よろしく
お願いします
2017年1月26日時点の情報です。
アップデートのペースが速いためご注意ください。
フォント: HGS明朝B
注意事項
本セッションでお伝えしたいこと
• Translatorの概要とTranslator APIの開発イメージ
• Cognitive Servicesを触ってみたいというモチベーション
1. Microsoft Translatorとは
2. Cognitive Services Translator API
3. Translator API 実装のフロー
Agenda
Microsoft Translator とは
Translate speech and text with simple REST API Call.
1.
歴史ある自動翻訳(=機械翻訳)のサービス
• クラウドベースの自動翻訳サービスhttps://www.microsoft.com/ja-jp/translator/at.aspx
• テキスト翻訳は60以上の言語で対応、音声翻訳は9言語で対応https://www.microsoft.com/en-us/translator/languages.aspx
• カスタムな辞書や翻訳をすることも可能(Translator Hub)
https://www.microsoft.com/ja-jp/translator/hub.aspx
• 料金は、無料お試し~月額で利用量に応じてテキストは文字数に応じて、音声は時間に応じて
https://www.microsoft.com/cognitive-services/en-us/pricing
たくさんの企業で使われています
利用している企業の一例として…
• Adobe
• Amazon
• Linked in
• Racuten
https://www.microsoft.com/en-us/translator/customers.aspx
Cognitive ServicesTranslator API
Translate speech and text with simple REST API Call.
2.
Translator APIとして提供している 5 機能
• Text Translation APIテキストをインプットとして、言語検出、翻訳を行いテキストを出力
• Speech Translation API音声をインプットとして、翻訳した結果を音声データで出力
• Hub (Translator Hub)ユーザー独自の辞書、独自の学習によりカスタムな翻訳
• Web WidgetWeb サイトをリアルタイムで、その場で翻訳することができるウィジェット
• CTF (Collaborative Translation Framework Reporting API)Microsoft Translator Text API の拡張で、翻訳されたテキストを公開後に改善する機能
DEMO
Web Widget
CTF
Tips 1. Text Translation API
• 2006 年から Microsoft グループ内部でテキスト翻訳に使用されており、2011 年からはお客様にも API として提供
• 応用統計学や機械学習の最近の進歩を活用
• ディープラーニングを応用した翻訳へ進化(2016/11月発表)
https://blogs.msdn.microsoft.com/translation/2016/11/15/microsoft-translator-launching-neural-network-based-translations-for-all-its-speech-languages/
Tips 2. Speech Translation API の翻訳プロセス
1. 自動音声認識• 深層ニューラルネットワーク(DNN)を使って高精度の音声分析して音声をテキスト化
2. TrueText(テキストの正規化)• 「うーん」や「ああ」や「それから」や「えーと」などの会話の間投詞や吃音や繰り返しを削除
• 文の区切れ目、適切な句読点を追加してテキストを正規化
3. 翻訳
4. テキストを音声に変換
Tips 2. Speech Translation API の翻訳プロセス(図)
https://www.microsoft.com/ja-jp/translator/at.aspxより
DEMO
Text Translator API
Translator API 実装のフロー
Give your solutions a human side.
3.
実装のフロー
1. Azure Portalでリソースの作成• リソースを作成し、APIにアクセスするためのキーを取得する
2. 実装 : 認証• キーを使ってOAuthのトークン取得する(Cognitive Services全般がこの方法)• トークンの有効期限は10分、定期的に更新する必要はある
3. 実装 : APIをCall• トークンを使ってAPIをCallし、翻訳結果を取得する• 実装するアプリでの使い方とAPIの料金プランを見ながら検討は必要か
DEMO
Azure Portalでリソース作成
実装
まとめ
本日のまとめ
• Translator API は、クラウドベースの機械翻訳サービス
• Translator HubやCTFなど翻訳サービスを拡張する機能もある
• アプリへの実装は、
リソース作成 → 認証の実装 → API Callを実装の3ステップ
• GitHubにMicrosoftのサンプルコードもたくさんあるYO
• 動かないときは、認証部分のコードを直すTO….?
Developer Resources
Preview Pricing• https://www.microsoft.com/cognitive-services/en-us/pricing
Documentation• https://www.microsoft.com/ja-jp/translator/
• https://www.microsoft.com/cognitive-services/en-us/translator-api
• https://www.microsoft.com/ja-jp/translator/hub.aspx
• http://docs.microsofttranslator.com/
Join Community• https://www.facebook.com/groups/cogbot/
• https://stackoverflow.com/questions/tagged/microsoft-cognitive
• https://social.msdn.microsoft.com/forums/azure/en-US/home?forum=mlapi
• https://cognitive.uservoice.com/
Enjoy Cogbot.
Thank you.
2017-1-27
Cogbot #4
Give your solutions a human side.
Top Related