Transcript

#aws_serverless

Introducing Amazon Rekognition, Amazon Polly and

Amazon LexKeisuke Nishitani (@Keisuke69)

Amazon Web Services Japan K.K.Dec 07, 2016

#aws_serverless

ProfileKeisuke NishitaniSpecialist Solutions Architect, Amazon Web Service Japan K.K

@Keisuke69 Keisuke69

✤ Specialist SA- Serverless- Mobile- DevOps- Application Service

✤ ソーシャルで⾚ドクロの⼈です✤ RESTおじさん✤ 餃⼦の王将エヴァンジェリスト(⾃称)✤ ⾳楽が好きです、フジロッカーです、今年も⾏きました✤ ブログ: http://keisuke69.hatenablog.jp/

Keisuke69 Keisuke69Keisuke69x

#aws_serverless

Amazon Rekognition

#aws_serverless

Amazon Rekognitionディープラーニングをベースとした画像認識サービス

数百万の画像を検索、検証、整理

物体およびシーン検知 顔の分析 顔の⽐較 顔認識

#aws_serverless

Amazon Rekognitionディープラーニングをベースとした画像認識サービス

数百万の画像を検索、検証、整理

物体およびシーン検知 顔の分析 顔の⽐較 顔認識DetectLabels DetectFaces CompareFaces IndexFaces

SearchFaceByImage

#aws_serverless

Amazon Rekognition API: DetectLables✤ 物体とシーンの検知

⎻ イメージ内の物体やシーンおよびコンセプトを検知

DetectLabels

{"Confidence": 94.62968444824219,"Name": "adventure"

},{

"Confidence": 94.62968444824219,"Name": "boat"

},{

"Confidence": 94.62968444824219,"Name": "rafting"

},. . .

#aws_serverless

Flower

ChairCoffeeTable

LivingRoom

Indoors

オブジェクトとシーンの検知

#aws_serverless

Maple

Villa

Plant

Garden

Water

SwimmingPool

Tree

PottedPlant

Backyard

オブジェクトとシーンの検知

#aws_serverless

Amazon Rekognition API: DetectFaces✤ 顔分析

⎻ 顔および特徴の検出[

{"BoundingBox": {"Height": 0.3449999988079071,"Left": 0.09666666388511658,"Top": 0.27166667580604553,"Width": 0.23000000417232513

},"Confidence": 100,"Emotions": [

{"Confidence": 99.1335220336914,"Type": "HAPPY" },

{"Confidence": 3.3275485038757324,"Type": "CALM"},

{"Confidence": 0.31517744064331055,"Type": "SAD"}

],"Eyeglasses": {"Confidence": 99.8050537109375,

"Value": false},"EyesOpen": {Confidence": 99.99979400634766,

"Value": true},"Gender": {"Confidence": 100,

"Value": "Female”}

DetectFaces

#aws_serverless

DemographicData

FacialLandmarks

SentimentExpressed

ImageQuality GeneralAttributes

顔分析

#aws_serverless

DemographicData

FacialLandmarks

SentimentExpressed

ImageQuality

Brightness:25.84

Sharpness:160GeneralAttributes

顔分析

#aws_serverless

Amazon Rekognition API: CompareFaces✤ 顔の⽐較

CompareFaces

{"FaceMatches": [

{"Face": {"BoundingBox": {"Height": 0.2683333456516266,"Left": 0.5099999904632568,"Top": 0.1783333271741867,"Width": 0.17888888716697693},

"Confidence": 99.99845123291016},"Similarity": 96

},{"Face": {"BoundingBox": {

"Height": 0.2383333295583725,"Left": 0.6233333349227905,"Top": 0.3016666769981384,"Width": 0.15888889133930206},

"Confidence": 99.71249389648438},"Similarity": 0

}],"SourceImageFace": {"BoundingBox": {

"Height": 0.23983436822891235,"Left": 0.28333333134651184,"Top": 0.351423978805542,"Width": 0.1599999964237213},

"Confidence": 99.99344635009766}}

#aws_serverless

#aws_serverless

Amazon Rekognition API: IndexFaces/SearchFacesByImage

f7a3a278-2a59-5102-a549-a12ab1a8cae8&v1

02e56305-1579-5b39-ba57-9afb0fd8782d& v2

FaceID&vector<float>Face

4c55926e-69b3-5c80-8c9b-78ea01d30690& v3

tran

sformed

stored

{f7a3a278-2a59-5102-a549-a12ab1a8cae8,02e56305-1579-5b39-ba57-9afb0fd8782d,4c55926e-69b3-5c80-8c9b-78ea01d30690}

IndexFaceCollection

#aws_serverless

Amazon Rekognition API: IndexFaces/SearchFacesByImage

Face

{f7a3a278-2a59-5102-a549-a12ab1a8cae8,02e56305-1579-5b39-ba57-9afb0fd8782d,4c55926e-69b3-5c80-8c9b-78ea01d30690}

SearchFacebyImage CollectionNearestneighborsearch

FaceID

#aws_serverless

#aws_serverless

ユースケース✤ 旅⾏サイトやフォーラムでは、ビーチ、キャンプ、⼭などのラベルでユーザーが作成し

た画像を分類

✤ 写真印刷サービスでベストな写真をリコメンド

✤ ⼩売店舗で、店内の顧客がどういった層であるかや感情を認識

✤ アドテクサービスでは顧客に動的にパーソナライズしたコンテンツを表⽰

✤ 家族写真共有アプリは、家族内の同じ⼈物のすべての顔をグループ化

✤ キャンパス/職場では顔検索を使⽤して、施設内の⼈が⽴ち⼊りを許可された⼈かどうかを確認

#aws_serverless

Benefit

フルマネージド AWSインテグレーション ローコストスケーラビリティ セキュア

#aws_serverless

Pricing✤ 無料枠:5000 images per month for first 12 months

ImageAnalysisTiers Priceper1000 imagesprocessed

First1millionimagesprocessed*permonth $1.00

Next9millionimagesprocessed*permonth $0.80

Next90millionimagesprocessed*permonth $0.60

Over100millionimagesprocessed*permonth $0.40

*Imagesprocessed:ForAPIswithimageasinput,it’sthenumberofimagesanalyzed.ForAPIswithnoimageinput1APIcall=1imageprocessed.

#aws_serverless

Amazon Polly

#aws_serverless

Amazon Pollyが⽣まれた背景✤ エンドユーザとのコミュニケーション⽤途で⾳声を使⽤するアプリが

より増えつつある

✤ ⽣成された⾳声が⾃然であるということは、ユーザエクスペリエンスの観点で重要

✤ ⾳声のインテグレーションはユースケースによって異なる

#aws_serverless

Amazon Pollyとは✤ Text to Speech as a Service

⎻ テキストをリアルな⾳声に変換するサービス

✤ 24⾔語で47の本物のような声を提供

✤ リアルタイムシステムの開発を可能にする低レイテンシなレスポンス

✤ ⽣成された⾳声を保存、再⽣、配信可能

#aws_serverless

Amazon Polly: 対応⾔語Americas:

• Brazilian Portuguese

• CanadianFrench

• English(US)

• Spanish(US)

A-PAC:

• Australian English

• IndianEnglish

• Japanese

EMEA:

• BritishEnglish

• Danish

• Dutch

• French

• German

• Icelandic

• Italian

• Norwegian

• Polish

• Portuguese

• Romanian

• Russian

• Spanish

• Swedish

• Turkish

• Welsh

• WelshEnglish

#aws_serverless

Amazon Polly: SSML✤ ⾳声合成マークアップ⾔語(Speech Synthesis Markup Language)

⎻ W3C推奨の⾳声合成アプリ向けのXMLベースのマークアップ⾔語

<speak>My name is Kuklinski. It is spelled <prosody rate='x-slow'>

<say-as interpret-as="characters">Kuklinski</say-as></prosody>

</speak>

#aws_serverless

Amazon Polly: Lexicons✤ 単語やフレーズの発⾳をカスタマイズ可能

✤ My daughter’s name is Kaja.

<lexeme><grapheme>Kaja</grapheme><grapheme>kaja</grapheme><grapheme>KAJA</grapheme><phoneme>"kaI.@</phoneme>

</lexeme>

#aws_serverless

TEXT

Marketgrewby>20%.WORDSPHONEMES

{ { { { {ˈtwɛn.tipɚ.ˈsɛntˈmɑɹ.kət ˈgɹu baɪ ˈmoʊɹ

ˈðæn

PROSODYCONTOURUNITSELECTIONANDADAPTATION

TEXTPROCESSING

PROSODYMODIFICATIONSTREAMING

Market grew by morethan

twentypercent

Speechunitsinventory

#aws_serverless

実装例(Python)from boto3 import Session

from contextlib import closing

polly = Session().client("polly")

response = polly.synthesize_speech(

Text="Hello world!",

OutputFormat="mp3", VoiceId="Joanna")

with closing(response["AudioStream"]) as stream:

with open("speech.mp3", "wb") as file:

file.write(stream.read())

#aws_serverless

Pricing✤ 従量課⾦

✤ 100万⽂字あたり$4

✤ ⽉あたり500万⽂字まで無料(最初の⼀年間)

✤ ⽣成された⾳声は保存して再⽣可能

#aws_serverless

Amazon Lex

#aws_serverless

Amazon Lexが⽣まれた背景

#aws_serverless

会話による相互作⽤の出現

1st Gen:PunchCards&MemoryRegisters

2nd Gen:Pointers&Sliders

3nd Gen:ConversationalInterfaces

#aws_serverless

会話型のアクセス

On-Demand

Accessible

Efficient

Natural

#aws_serverless

⾳声とテキストを使った会話型インターフェースを構築

するための新サービス

Amazon Lex

#aws_serverless

Amazon Lex - 特徴Alexaと同じ技術を⽤いた、テキストと⾳声⾔語の理解

エンタープライズシステムに接続する、エンタープライズSaaSコネクタ

チャットサービスへのデプロイ

会話を構築するための効率的で直感的なツール、⾃動でスケール

バージョニングとエイリアスのサポート

#aws_serverless

テキストと⾳声⾔語理解

⾳声認識 ⾃然⾔語理解

Alexaと同じディープラーニング技術を搭載

#aws_serverless

チャットサービスへのデプロイ

AmazonLex

FacebookMessenger

CardDescriptionButton1Button2Button3

CardDescription

Option1

Option2

Authentication

RichFormattingOne-ClickDeployment

Mobile

#aws_serverless

ビルダー向けのデザイン

Efficientandintuitivetoolstobuildconversations

#aws_serverless

バージョニングとエイリアスのサポート

AliasVersioning

v1 v2 v3 latest

• インテント、スロット、ボットでサポート

• 複数の開発者による環境をサポート

• 以前のバージョンへロールバック

v1 Dev

v2 Stage

v3 Prod

• 異なるプラットフォームへ異なるエイリアスをデプロイ

• 開発、ステージング、本番環境で異なるスタックを実⾏

• 異なるエイリアスで異なるユーザグループをターゲット

#aws_serverless

AWS Mobile Hubとのインテグレーションユーザ認証

ユーザの⾏動分析

メディアの保存とシェア

データ同期

More….リテンションの追跡

会話形ボットLexAWS Mobile SDKs

AWS Mobile Hub

#aws_serverless

Mobile Hubによるコネクタ

AmazonLex

MobileApp

MobileHubSaaSConnector

AmazonAPIGateway

AWSLambda

1:Understanduserintent

AmazonAPIGateway

AWSLambda

3:TranslateRESTresponseintonaturallanguage

MobileHubCustomConnector

2:InvokeaSaaSapplicationoranexistingbusinessapplication

BusinessApplication

Firewall

UserInput

#aws_serverless

Amazon Lex – Use CasesInformationalBots⽇々消費者のリクエストに答えるチャットボット

ApplicationBotsモバイルアプリにパワフルなインターフェースを構築

• 新着ニュース• 天気• スポーツのスコア….

• チケット予約• フードの注⽂• 銀⾏⼝座の管理….

EnterpriseProductivityBots企業の業務を合理化し、効率を向上

• セールス番号の確認• マーケティングのパフォー

マンス• 在庫状況….

InternetofThings(IoT)Botsデバイスとのやり取りで会話型インターフェースを利⽤可能に

• ウェアラブル• アプライアンス• ⾞….

#aws_serverless

Amazon Lex - メリット

⾼品質なテキストと⾳声⾔語理解

AWSプラットフォームとのインテグレーション

シームレスなデプロイとスケール

簡単に使える

費⽤対効果が⾼い

#aws_serverless

Lex Botの構造

Utterancesインテントを呼び出す⾳声もしくは⼊⼒によるフレーズ

BookHotelIntents⾃然⾔語のユーザー⼊⼒に応答してアクションを実⾏

Slotsインテントを実⾏するために必要な⼊⼒データ

Fulfillmentインテントのための実⾏メカニズム

#aws_serverless

Fulfillment

AWSLambdaIntegration ReturntoClient

ユーザの⼊⼒はインテントとスロット値を得るためにパースされたユーザ⼊⼒。追加処理のためにアウトプットをク

ライアントへ返却

ビジネスロジック実装のためインテントとスロットはAWS

Lambdaにパスされる

#aws_serverless

“Book a Hotel”Book Hotel

NYC

“BookaHotelinNYC”

⾃動的に⾳声認識

Hotel Booking

New York City

⾃然⾔語理解 Intent/Slotモデル

UtterancesHotelBooking

City NewYorkCity

Check In Nov30th

CheckOut Dec2nd

“YourhotelisbookedforNov30th”

Polly確認:“Yourhotelisbookedfor

Nov30th”

ain

“CanIgoaheadwiththebooking?

#aws_serverless

Save, Build and Publish

Save Build

ボットを保存することでサーバ上に現在の状態が保

存される

ボットをビルドすることでテスト可能なバージョンを作成

Publish

ボットをパブリッシュして、ボットのバージョンとエイリアスを作成

Test

コンソール上のチャットウィンドウでボットをテスト

#aws_serverless

Monitoring

Trackyourbot

RequestLatency

MissedUtteranceCount

#aws_serverless

Pricing

Text Speech

Priceper1000requests $0.75 $4.00

FreeTier*(requestspermonth) 10,000 5,000

*Availableforthefirstyearuponsign-uptonewAmazonLexcustomers

#aws_serverless


Recommended