Alexa Skill KitでAmazonが用意したBuilt-In IntentとBuilt-In Slot Typeをひたすらまとめてみる

2017.04.11

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

惜春の候, 春風の心地よい季節になりましたが、お変わりなくお過ごしでしょうか、せーのです。今日はAlexaでスキルを作る時に見落としがちなスタンダードセットをまとめます。

Intent, Slot, Utteranceのおさらい

AlexaでCustom Skillを作る時、一番大事なのはこの画面です。

built-in-slot1

ここでEchoなどのAlexa製品に話しかけられた言葉を分析してバックエンドのLambdaが処理しやすいようにJSON形式にまとめる為の設定を行っています。
どのIntentに振り分けるか、をSample Utteranceで定義し、その中でLambda内で変数として必要なフレーズをSlotとして抽出します。

例えば「Alexa, 昨日の日ハム戦の結果を教えて」というフレーズをLambdaに送って野球の結果を教えるようなSkillを作る場合大事なのは、

  • このフレーズを言ったら野球の結果を教える処理に飛ばすこと
  • 「昨日」というフレーズを対象日付として変数化
  • 「日ハム戦」というフレーズを対象ゲームとして変数化

という設定を行うことです。これをSample Utterance風に書くと

<野球の結果検索Intent> {日付}の{対象ゲーム}の結果を教えて

となります。<野球の結果検索Intent>がIntent名、{日付}{対象ゲーム}がSlotです。

Built-Inが一番精度が高い

これらのIntentを設定する際に一番単純なのは[Sample Utterance]の欄にひたすら「こんな感じで聞かれそうだな」というサンプル文を書きまくる事です。Alexaの言語解釈にはDeep Learningが働いていますので多少の言語のブレはAlexaが吸収してくれます。後はなるべくそのブレ内に収まるように色々なパターンのサンプルを書くことになります。このサンプルの量が実際の精度を分けます。Slotも同じでCustom Slotになるべく多くのパターンのサンプルSlotを書くとSlotとしてヒットしやすくなります。1語(Apple、など)のサンプルばかりだと2語以上のSlot対象には反応しなくなります。あらかじめ2語(Personal Computer、など)のサンプルを入れておくと2語でもSlotとして反応してくれます。

しかしIntentやSlotには最初からAmazonが用意している「Built-In Intent」「Built-In Slot」というものがあります。これらには会話でよく使うカテゴリーのサンプルがかなりの数用意されています。これらのIntentやSlotはサンプルを用意する必要がなく、Amazonが用意しているもののため、その精度は高いです。どんなタイプのIntentやSlotがあるのかを把握しておいて、上手に活用していきましょう。

まとめ

Intent

Intent名 サンプル 内容
AMAZON.CancelIntent "cancel","never mind","forget it" 会話をやめたり注文をキャンセルする
AMAZON.HelpIntent "help","help me","can you help me" スキルの解説や操作法を教える
AMAZON.LoopOffIntent "loop off" トラックのループを止めたりリピートを解除したりする
AMAZON.LoopOnIntent "loop","loop on","keep repeating this song" トラックのループを始めたりリピートを開始したりする
AMAZON.NextIntent "next","skip","skip forward" リストの次の項目に飛ばす
AMAZON.NoIntent "no","no thanks" 「いいえ」の意味全般
AMAZON.PauseIntent "pause","pause that" ゲームやオーディオの一時停止をする
AMAZON.PreviousIntent "go back","skip back","back up" リストの前の項目に飛ばす
AMAZON.RepeatIntent "repeat","say that again","repeat that" ユーザが最後のアクションを繰り返す
AMAZON.ResumeIntent "resume","continue","keep going" 操作を再開する、続行させる
AMAZON.ShuffleOffIntent "stop shuffling","shuffle off","turn off shuffle" プレイリスト等のシャッフルを止める
AMAZON.ShuffleOnIntent "shuffle","shuffle on","shuffle the music","shuffle mode" プレイリスト等のシャッフルをする
AMAZON.StartOverIntent "start over","restart","start again" ゲームやアクションを再開させる
AMAZON.StopIntent "stop","off","shut up" スキルを止める、行動を止める
AMAZON.YesIntent "yes","yes please","sure" 「はい」の意味全般

Slot

Slot名 サンプル 内容
AMAZON.DATE "today","tomorrow","july" 日付
AMAZON.DURATION "five minutes" 時間経過
AMAZON.FOUR_DIGIT_NUMBER "nineteen forty five" 4桁の暗証番号
AMAZON.NUMBER "five" 数字
AMAZON.TIME "four in the morning","two p m" 時刻
AMAZON.Actor "amy adams","emma watson" 俳優、女優
AMAZON.AdministrativeArea "mason city","oxnard california" 政府管理施設
AMAZON.AggregateRating "best","five star","popular","top ten" アイテムの評価
AMAZON.Airline "delta airlines","british airways" 航空会社
AMAZON.Airport "john f. kennedy memorial airport","logan" 空港
AMAZON.Animal "common frog","funnel web spider" 動物
AMAZON.Artist "justin bieber","michael jackson" アーティスト
AMAZON.Athlete "kobe bryant","michael phelps" アスリート
AMAZON.Author "mark twain","stephen king" 小説家
AMAZON.Book "gone girl","harry potter" 本の名前
AMAZON.BookSeries "harry potter","silence of the lambs" シリーズ本
AMAZON.BroadcastChannel "colorado public radio","king fm" TV、ラジオ放送局
AMAZON.CivicStructure "greyhound bus station","museum of modern art" 公共施設
AMAZON.Color "lemon","red","sea blue"
AMAZON.Comic "the amazing spiderman","x-men" 漫画
AMAZON.Corporation "amazon","apple" 企業の正式名称
AMAZON.Country "argentina","new zealand"
AMAZON.CreativeWorkType "album","magazine" クリエイティブ作品用の単語
AMAZON.DayOfWeek "friday","monday" 曜日
AMAZON.Dessert "chocolate brownie","chocolate ice cream" デザート
AMAZON.DeviceType "air conditioner","camera" デバイス
AMAZON.Director "alfred hitchcock","martin scorsese" 映画監督
AMAZON.Drink "coke","martini" 飲み物
AMAZON.EducationalOrganization "juilliard school","university of york" 教育機関
AMAZON.EUROPE_CITY "kempten","loures" ヨーロッパの都市
AMAZON.EventType "game","holiday" イベントのタイプ
AMAZON.Festival "2013 comic con international","south by southwest" フェスティバル
AMAZON.FictionalCharacter "batman","captain america" 架空の作品のキャラクター名
AMAZON.FinancialService "bank of america","standard life" 金融サービス
AMAZON.Food "bacon","scrambled egg" 食べ物
AMAZON.FoodEstablishment "taco time","skipper’s dockside" 食品会社
AMAZON.Game "angry birds","halo" ゲーム名
AMAZON.Genre "fantasy","jazz" 本や音楽のジャンル
AMAZON.Landform "amazon","mount everest" 山、川、海などの地形の名前
AMAZON.LandmarksOrHistoricalBuildings "holy trinity church","madison square" 歴史的建造物
AMAZON.Language "english us","japanese" 言語
AMAZON.LocalBusiness "disneyland","starbucks" ビジネス
AMAZON.LocalBusinessType "auto rental store","dry cleaning" 検索する可能性のあるビジネスの名前
AMAZON.MedicalOrganization "children’s speech therapy center" 医療機関
AMAZON.Month "april","december"
AMAZON.Movie "mad max fury road","star wars" 映画
AMAZON.MovieSeries "alien","rocky" シリーズ映画
AMAZON.MovieTheater "cinemark movies ten","liberty theater dayton" 映画館
AMAZON.MusicAlbum "thriller","joshua tree" 音楽アルバム
AMAZON.MusicCreativeWorkType "music video","single" 曲やトラックなどの音楽作品を説明する言葉
AMAZON.MusicEvent "broken music tour","warped tour" コンサート等の音楽関連イベント
AMAZON.MusicGroup "the beatles","coldplay" 音楽グループ
AMAZON.Musician "beyonce","madonna" ミュージシャン
AMAZON.MusicPlaylist "bachelorette party","dance" 音楽プレイリストによく使われる名前
AMAZON.MusicRecording "paint it black","smells like teen spirit" 録音トラックのタイトル
AMAZON.MusicVenue "jack’s joint","mohegan sun arena" コンサートホール名
AMAZON.MusicVideo "one more time","shake it off" ミュージックビデオ
AMAZON.Organization "amazon","microsoft" 非政府組織
AMAZON.Person "mark twain","stephen king" 人のフルネーム
AMAZON.PostalAddress "10550 n. la canada","2 akita dr." 住所、通りの名前
AMAZON.Professional "bill gates","michael jordan" プロとして有名な人
AMAZON.ProfessionalType "banker","lawyer" 職業
AMAZON.RadioChannel "bbc radio","kiss fm" ラジオチャンネルと番組
AMAZON.Residence "arlington","moore house" よく知られている住所
AMAZON.Room "bathroom","lobby" 部屋の名前
AMAZON.ScreeningEvent "hollywood film festival","oldenburg international film festival" 映画イベント
AMAZON.Service "coastal culinary personal chef service","the omelet" サービス
AMAZON.SocialMediaPlatform "facebook", "you tube" SNS
AMAZON.SoftwareApplication "pokemon go","windows" アプリ
AMAZON.SoftwareGame "magic eightball","akinator" クイズ、パズル、単語ゲーム
AMAZON.Sport "basketball","football" スポーツ
AMAZON.SportsEvent "1990 fifa world cup","senior women race" スポーツイベント
AMAZON.SportsTeam "bruins","red bulls" スポーツチーム
AMAZON.StreetAddress "cochran","town center s." 番地ではなく通りの名前
AMAZON.TelevisionChannel "abc","cnn","cartoon network" テレビチャンネル
AMAZON.TVEpisode "jaynestown","our mrs reynolds" テレビエピソード
AMAZON.TVSeason "amazing race 2","big brother 3 us" テレビシーズン
AMAZON.TVSeries "homeland","star trek" テレビシリーズ
AMAZON.US_CITY "new york","seattle" アメリカの都市
AMAZON.US_FIRST_NAME "annie","john" アメリカ人の名前
AMAZON.US_STATE "alabama","guam" アメリカの州
AMAZON.VideoGame "doom two","lemmings" ビデオゲーム
AMAZON.WeatherCondition "blizzard","rain" 気候条件
AMAZON.WrittenCreativeWorkType "fiction","novel" 書物や詩などの作品を説明する言葉

まとめのまとめ

いかがでしたでしょうか。意外と守備範囲が広くて驚かれたのではないでしょうか。これらのBuilt-Inを上手に使いながらスキルを作成していきましょう。