22
Microsoft Cognitive Services の Translator を個人的にまとめてみました。 2017-1-27 Cogbot #4 session version

Translator API (Microsoft Cognitive Services)の概要

Embed Size (px)

Citation preview

Page 1: Translator API (Microsoft Cognitive Services)の概要

Microsoft Cognitive Services の

Translatorを個人的にまとめてみました。

2017-1-27

Cogbot #4session version

Page 2: Translator API (Microsoft Cognitive Services)の概要

@BEACH_SIDE

横浜 篤よこはま あつし

http://beachside.hatenablog.com/

Using…

C#, ASP.NET, Azure, Machine Learning, Xamarin ….

所属の会社では、開発者募集しています♪

I’m a C#er.

よろしく

お願いします

Page 3: Translator API (Microsoft Cognitive Services)の概要

2017年1月26日時点の情報です。

アップデートのペースが速いためご注意ください。

フォント: HGS明朝B

注意事項

Page 4: Translator API (Microsoft Cognitive Services)の概要

本セッションでお伝えしたいこと

• Translatorの概要とTranslator APIの開発イメージ

• Cognitive Servicesを触ってみたいというモチベーション

Page 5: Translator API (Microsoft Cognitive Services)の概要

1. Microsoft Translatorとは

2. Cognitive Services Translator API

3. Translator API 実装のフロー

Agenda

Page 6: Translator API (Microsoft Cognitive Services)の概要

Microsoft Translator とは

Translate speech and text with simple REST API Call.

1.

Page 7: Translator API (Microsoft Cognitive Services)の概要

歴史ある自動翻訳(=機械翻訳)のサービス

• クラウドベースの自動翻訳サービス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

Page 8: Translator API (Microsoft Cognitive Services)の概要

たくさんの企業で使われています

利用している企業の一例として…

• Adobe

• Amazon

• Linked in

• Twitter

• Racuten

https://www.microsoft.com/en-us/translator/customers.aspx

Page 9: Translator API (Microsoft Cognitive Services)の概要

Cognitive ServicesTranslator API

Translate speech and text with simple REST API Call.

2.

Page 10: Translator API (Microsoft Cognitive Services)の概要

Translator APIとして提供している 5 機能

• Text Translation APIテキストをインプットとして、言語検出、翻訳を行いテキストを出力

• Speech Translation API音声をインプットとして、翻訳した結果を音声データで出力

• Hub (Translator Hub)ユーザー独自の辞書、独自の学習によりカスタムな翻訳

• Web WidgetWeb サイトをリアルタイムで、その場で翻訳することができるウィジェット

• CTF (Collaborative Translation Framework Reporting API)Microsoft Translator Text API の拡張で、翻訳されたテキストを公開後に改善する機能

Page 11: Translator API (Microsoft Cognitive Services)の概要

DEMO

Web Widget

CTF

Page 12: Translator API (Microsoft Cognitive Services)の概要

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/

Page 13: Translator API (Microsoft Cognitive Services)の概要

Tips 2. Speech Translation API の翻訳プロセス

1. 自動音声認識• 深層ニューラルネットワーク(DNN)を使って高精度の音声分析して音声をテキスト化

2. TrueText(テキストの正規化)• 「うーん」や「ああ」や「それから」や「えーと」などの会話の間投詞や吃音や繰り返しを削除

• 文の区切れ目、適切な句読点を追加してテキストを正規化

3. 翻訳

4. テキストを音声に変換

Page 14: Translator API (Microsoft Cognitive Services)の概要

Tips 2. Speech Translation API の翻訳プロセス(図)

https://www.microsoft.com/ja-jp/translator/at.aspxより

Page 15: Translator API (Microsoft Cognitive Services)の概要

DEMO

Text Translator API

Page 16: Translator API (Microsoft Cognitive Services)の概要

Translator API 実装のフロー

Give your solutions a human side.

3.

Page 17: Translator API (Microsoft Cognitive Services)の概要

実装のフロー

1. Azure Portalでリソースの作成• リソースを作成し、APIにアクセスするためのキーを取得する

2. 実装 : 認証• キーを使ってOAuthのトークン取得する(Cognitive Services全般がこの方法)• トークンの有効期限は10分、定期的に更新する必要はある

3. 実装 : APIをCall• トークンを使ってAPIをCallし、翻訳結果を取得する• 実装するアプリでの使い方とAPIの料金プランを見ながら検討は必要か

Page 18: Translator API (Microsoft Cognitive Services)の概要

DEMO

Azure Portalでリソース作成

実装

Page 19: Translator API (Microsoft Cognitive Services)の概要

まとめ

Page 20: Translator API (Microsoft Cognitive Services)の概要

本日のまとめ

• Translator API は、クラウドベースの機械翻訳サービス

• Translator HubやCTFなど翻訳サービスを拡張する機能もある

• アプリへの実装は、

リソース作成 → 認証の実装 → API Callを実装の3ステップ

• GitHubにMicrosoftのサンプルコードもたくさんあるYO

• 動かないときは、認証部分のコードを直すTO….?

Page 21: Translator API (Microsoft Cognitive Services)の概要

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/

Page 22: Translator API (Microsoft Cognitive Services)の概要

Enjoy Cogbot.

Thank you.

2017-1-27

Cogbot #4

Give your solutions a human side.