ããã«ã¡ã¯ãæè¡4課ã®å¤ç°ã§ãã
ãã®è¨äºã¯ãAmazon Alexa Advent Calendar 2017ã®14æ¥ç®ã®æ稿è¨äºã§ãã
Alexa対å¿ããã¤ã¹ãæã«å
¥ããã®ã ãããªãªã¸ãã«ã®Alexa Skillsãéçºãããï¼ ãããªè¡åã«ãããã人ãå¤ãã®ã§ã¯ãªãã§ããããï¼
ç§ããã®1人ã§ãï¼
ä»åã¯ãAlexa Skillsãéçºããããã®å種æ
å ±ãæ´çãã¦ã¿ããã¨æãã¾ãã
Alexaã®å¦çã¤ã¡ã¼ã¸
Alexaã§å¦çãè¡ããã¨ããã¨ãã®å¤§ã¾ããªã¤ã¡ã¼ã¸ã¨ãã¦ã¯ä»¥ä¸ã®å³ã«ãªãã¾ãã
ã¦ã¼ã¶ã¼ããAlexaããããã¨Alexa対å¿ããã¤ã¹ã«ãªã¯ã¨ã¹ããè¡ãã¨ãAlexaã声ã¨è¨èãå¤æãã¦Alexa Skillsã§å¦çå¾ãçµæãã¦ã¼ã¶ã¼å´ã«è¿ãã¾ãã
Alexaã®ç¨èªæ´ç
次ã«ãAlexaã«ã¯ããã¤ãã®ç¨èªãããã®ã§ãããAlexa Skillséçºã«å¿ è¦ãªç¨èªãæ´çãã¦ããã¾ãã
ASK
ASKã¯ãAlexa Skill Kitã®ç¥ç§°ã§ãã
Alexaããã¤ã¹ã®ã¹ãã«ãéçºããã«ã¯ASKãå¿
è¦ã«ãªãã¾ãã
ãªããé¢é£ã§AVS(Alexa Voice Service)ãããã¾ãããããã¯ç¬èªã®ããã¤ã¹(ã©ãºãã¤ã¨ã)ã¨Alexaé£æºããããã®ä»çµã¿ã§ãã
Intent
ã¦ã¼ã¶ã¼ã®ã¡ãã»ã¼ã¸ã®æå³(Intent)ãå®ç¾©ãã¾ãã
ä¾ãã°ããAlexaãæ±äº¬ã®å¤©æ°ã¯ï¼ãã¨ãããªã¯ã¨ã¹ããããã°ããæ±äº¬ã®å¤©æ°ããã¦ã¼ã¶ã¼ãç¥ãããæ
å ±ããããIntentã«ãªãã¾ãã
Slot
Intentã®å¤æ°ã®ãããªãã®ãSlotã«ãªãã¾ãã
ä¾ãã°ããAlexaãæ±äº¬ã®å¤©æ°ã¯ï¼ãã¨ãããªã¯ã¨ã¹ããããã°ããæ±äº¬ãã¨ããé¨åãSlotã«ãªãã¾ãã
ä¸è¨ã®ããã«è¨å®ãããã¨ã§æ§ã
ãªå°åã®å¤©æ°ãã¬ã¹ãã³ã¹ã§ããããã«ãªãã¾ãã
Intent Schema
Intentã¨Slotã®æ
å ±ã¯ãIntent Schemaã¨ããJSONå½¢å¼ã§ã¹ãã«ã«è¨å®ãã¾ãã
ä¾ã¨ãã¦ã¯ä»¥ä¸ã®ãããªãã®ã§ãã
{
"intents": [
ãã{
ããã"intent": "WeatherIntent",
ããã"slots": [
ããããã{"name": "CityName","type": "City"}
ããã]
ãã},
ãã{"intent": "AMAZON.HelpIntent"},
ãã{"intent": "AMAZON.StopIntent"}
ã]
}
Utterance
ã¦ã¼ã¶ã¼ã®ã¡ãã»ã¼ã¸ãé©åãªIntentåã³Slotã«ç´ã¥ããããã®æ
å ±ã§ãã
ä¾ãã°ãæ±äº¬ã®å¤©æ°ãç¥ãããã¨ããã¦ã¼ã¶ã¼ã®ã¡ãã»ã¼ã¸ã¯ã人ã«ãã£ã¦æ§ã
ã ã¨æãã¾ãã
æ±äº¬ã®å¤©æ°ãæãã¦ï¼ã¨ããæ¹ãããã°ãæ±äº¬ã®å¤©æ°ã¯ï¼ã¨ããæ¹ããããã¨æãã¾ãããæ§ã
ãªã¡ãã»ã¼ã¸ã®ãã¿ã¼ã³ãå®ç¾©ãã¦ãããAlexaãè¿çåºæ¥ãããã«ããå¿
è¦ãããã¾ãã
Alexa Skillsã®éçºæºå
Alexaã®å¦çã¤ã¡ã¼ã¸ãç¨èªã®æ´çãè¡ã£ãã®ã§å®éã«éçºã®ããã®æºåããã¾ããããéçºã®ããã®ã¢ã«ã¦ã³ãé¡
ã¾ãã¯ãéçºã«å¿ è¦ãªã¢ã«ã¦ã³ãå¨ãã§ãã ããããæä½éå¿ è¦ã§æ´ã«ã³ã¼ããæ¸ãã¦ããã®ã§é©å®Githubãããã¨ããããããã¾ãããAlexa Skillsã®ããã¥ã¡ã³ãããµã³ãã«ã³ã¼ããªã©
次ã«ãAlexa Skillã®ããã¥ã¡ã³ãããµã³ãã«ã³ã¼ããªã©ã®Githubã«ã¤ãã¦ã§ããã以ä¸ã®ãªã³ã¯å ã«ããã¾ãã ããã¥ã¡ã³ãã¯ããããããã¨ã«æ¥æ¬èªå¯¾å¿ãã¦ãã¾ããã¾ããéçºã§ããè¨èªã¯ãnode.jsã¨Javaãããã¾ãã
Alexa Skillsãéçºãã¦ã¿ã
Alexa Skillsã«ã¯ç¾å¨3ã¤ã®ç¨®é¡ãããã¾ãã- ã«ã¹ã¿ã ã¹ãã«
- ã¹ãã¼ããã¼ã ã¹ãã«
- ãã©ãã·ã¥ããªã¼ãã£ã³ã°ã¹ãã«
ä»åã¯ã«ã¹ã¿ã ã¹ãã«ã®ãµã³ãã«ã¹ãã«ã¨ãã¦è±ç¥èã¹ãã«ãLambdaã«ãããã¤ãã¦ã¿ã¾ãã
ãµã³ãã«ã¹ãã«ã®éçº
ã¾ãã¯ãéçºè ã¢ã«ã¦ã³ãã«ãã°ã¤ã³ãã¦ãAlexa Skills Kitãé¸æãã¾ãã ãæ°ããã¹ãã«ã追å ããããã¿ã³ãã¯ãªãã¯ãã¦ãã«ã¹ã¿ã ã¹ãã«ã®åºæ¬æ å ±ãå ¥åãã¾ãã ç¶ãã¦ãIntentãIntent Schemaãªã©ã®å¯¾è©±ã¢ãã«ã®è¨å®ãè¡ãã¾ãããä»åã¯ãSKILL BUILDERããå©ç¨ãã¦è¨å®ãã¦ã¿ã¾ãããAdd IntentãããIntentã®ã¡ãã»ã¼ã¸ã追å ãã¦ããã¾ãã å ¥åãçµããã¾ãããããSave Modelããã¿ã³ãã¯ãªãã¯ãã¦ããã®å¾ãBuild Modelããã¿ã³ãã¯ãªãã¯ãã¾ãã
ãã«ããæåãã¾ããã次ã«Lambdaã®ã³ã¼ãã®è¨å®ãè¡ãã¾ãã
ä»åã®ãµã³ãã«ã¹ãã«ã«å¯¾å¿ããLambda Functionã¯ãalexa-skill-kit-sdk-factskillãã«ãªãããããé¸æãã¾ãã Lambdaã®ããªã¬ã¼ã«ãAlexa Skill Kitããé¸æãã¾ããè¨å®å®äºå¾ã³ã¼ããä¿åãã¾ãã
ãã®å¾ãå¾ç¶ã®è¨å®ã®ããã«Lambdaã®ARNãã³ãã¼ãã¦ããã¾ãã ããã¦ãé³å£°ã¦ã¼ã¶ã¼ã¤ã³ã¿ãã§ã¼ã¹(VUI)ã¨Lambdaã®ã³ã¼ããé£æºãã¾ãã
ã³ãã¼ãã¦ãããLambdaã®ARNãè²¼ãä»ãã¦ããã®ã¾ã¾æ¬¡ã¸ãã¿ã³ãæ¼ãã¦ãã ããã æå¾ã«ãAlexa Skillsã®ãã¹ããè¡ãã¾ãã
Intentã«è¨å®ããã¡ãã»ã¼ã¸ã§æå¾ ããçµæãè¿ã£ã¦ãããã確èªãã¾ãã
åé¡ãªããè±ç¥èã®ãã¼ã¿ãè¿ã£ã¦ãã¦ãã¾ãï¼
Alexa Skillsãå ¬éãã
ãã®ããã«ä½ã£ãã¹ãã«ã¯å ¬éãã¦ä¸è¬å©ç¨ã§ããããã«ãã¦ããããã§ããããå ¬éããå ´åã®Tipsããã¡ãã®ããã°ã§ç´¹ä»ããã¦ãã¾ãã
ã¹ã ã¼ãºã«å¯©æ»ãéãã°ã7å¶æ¥æ¥å ã«å ¬éãããã¨ã®ãã¨ã§ãã
èªå®è¦ä»¶ã¯ãAmazonã®ãã¯ãã«ã«ããã¥ã¡ã³ãã§ã覧ããã ããã¨ãã§ãã¾ãã®ã§ãå 容ã確èªããªããã¹ãã«ã®éçºã»ç³è«æºåãé²ãã¾ããããã¹ã ã¼ãºã«å¯©æ»ã«ééããã°ã7å¶æ¥æ¥å ã«ã¹ãã«ãå ¬éãããã¨ãã§ãã¾ãã
ã¾ã¨ã
Alexa Skillsã®éçºã«ããã£ã¦ã®æ
å ±ãæ´çãã¦ã¿ã¾ããã
Alexaé¢é£ã®ãã¸ãã¹å±éã¯æ¡å¤§ä¸ã§ãã¤ãAlexa Skillsã®éçºãã©ãã©ã伸ã³ã¦ãã¾ã(ç¾æç¹ã§25,000ã¹ãã«ãçªç ´ï¼)
ç§ããªãªã¸ãã«ã¹ãã«ã®éçºã«ãã©ã¤ãã¦ã¿ã¦ããã®æ¨¡æ§ãã¾ãããã°ã«æ¸ãããã¨æã£ã¦ãã¾ãã
ã¡ãªã¿ã«ãæ³äººå¶æ¥èª²ã®å°æãCloudAutometorã®ã¹ãã«ãéçºãã¦ããããã®ã§ããã¡ãããã²ã覧ãã ããï¼
ããã§ã¯ï¼