Share
Embed
Conversation as a Platform in 2016
生成AIでのUXの革新の真っ只中に私たちはいます。よくあるのがChatのUIですが、そこでの設計のノウハウはBotがDeep LearningベースのAIモデルとともに活用され始めた2016年ごろから開発の現場に蓄積されています。
このデッキでは、当時のMicrosoftのChat Bot開発のノウハウをまとめています。
- Canvas
- Agent
- Bot
- アンチパターン
- Bot Framework
- LUIS
- Microsoft Graph
- Speech
https://blogs.microsoft.com/blog/2016/08/03/progress-in-the-shift-to-conversational-computing/
Daiyu Hatakeyama | @dahatake | 畠山 大有
March 19, 2025
Annual Pro sale · Save $30
Have presentations of your own?
Share with private links, password protection, and more control over your work.
Transcript
153 slides
-
#azurejp #azurejp コンピューターともっと対話する時代 - Conversation as a Platform とは -
畠山 大有 日本マイクロソフト株式会社 プリンシパル ソフトウェア デベロップメント エンジニア https://www.facebook.com/dahatake/ https://twitter.com/dahatake/ https://github.com/dahatake/ https://daiyuhatakeyama.wordpress.com/ https://www.slideshare.net/dahatake/ -
#azurejp mid-80s デスクトップOS Dos, Windows, Mac OS プログラム Excel, PPT,
Lotus GUI Apps PC ブラウザー Mosaic, Explorer, Netscape Web サイト Yahoo, Amazon Web ページ mid-90s Web モバイル OS iOS, Android, WP アプリ Angry Birds, Instagram ネイティブ アプリ mid-00s スマートフォン メッセージング アプリ Whatsapp, WeChat, Skype ボット / エージェント Weather, Travel 会話 mid-10s メッセージング New era of Computing… -
#azurejp The majority of people’s time – 84 percent –
is spent using just 5 apps they’ve installed from the App Store. 人々が費やす時間の大半(84%)は、Appスト アからインストールしたわずか5つのアプリで消費さ れます。 Source: Forrester Research -
#azurejp Social as a Platform OS Windows iPhone Android Facebook
SNS As Platform Twitter LINE Bot -
James Whittaker Fri 2/23/2013 4:35 PM Jennifer Whittaker OF Monsters
And Men Coming! Hey Dad, One of my favorite bands, Of Monsters And Men, is coming to the Paramount Theater in May. OMG!!! I WANT to seem them and would LOVE to see them with my concert buddy! ☺ ☺ ☺ ☺ Father and daughter night out (your treat…lucky!) Let me know…, NOW!!!!!!!! ;) TTYL, Jen Action Broker Message + Get More Apps -
James Whittaker Fri 2/23/2013 4:35 PM Jennifer Whittaker OF Monsters
And Men Coming! Hey Dad, One of my favorite bands, Of Monsters And Men, is coming to the Paramount Theater in May. OMG!!! I WANT to seem them and would LOVE to see them with my concert buddy! ☺ ☺ ☺ ☺ Father and daughter night out (your treat…lucky!) Let me know…, NOW!!!!!!!! ;) TTYL, Jen Message Action Broker + Get More Apps -
James Whittaker Fri 2/23/2013 4:35 PM Jennifer Whittaker OF Monsters
And Men Coming! Hey Dad, One of my favorite bands, Of Monsters And Men, is coming to the Paramount Theater in May. OMG!!! I WANT to seem them and would LOVE to see them with my concert buddy! ☺ ☺ ☺ ☺ Father and daughter night out (your treat…lucky!) Let me know…, NOW!!!!!!!! ;) TTYL, Jen Message Action Broker + Get More Apps Band Overview Buy Music Top Videos Similar Artists Of Monsters And Men biography After winning the nationwide 2010 battle-of- the-bands competition Musiktilraunir in their native Iceland, six-piece chamber pop group Of Monsters and Men were hailed as "the new Arcade Fire" in Rolling Stone magazine. A bidding war ensued, and the group signed with Universal Music Group. In the beginning of 2012, a four-song EP titled Into the Woods was issued as a preview to their full-length debut, My Head Is an Animal, which was released in the States that spring. -
James Whittaker Fri 2/23/2013 4:35 PM Jennifer Whittaker OF Monsters
And Men Coming! Hey Dad, One of my favorite bands, Of Monsters And Men, is coming to the Paramount Theater in May. OMG!!! I WANT to seem them and would LOVE to see them with my concert buddy! ☺ ☺ ☺ ☺ Father and daughter night out (your treat…lucky!) Let me know…, NOW!!!!!!!! ;) TTYL, Jen Message Action Broker + Get More Apps Overview Buy Tickets Seating Chart Maps & Directions Nearby Paramount Theater Seattle, WA 901 Pine Street 98101 An iconic venue in the heart of Seattle, the Paramount Theater presents the best in Broadway shows and live entertainment. Originally opened in 1928 the theater has been restored and maintained as one of Seattle's premier entertainment venues. -
James Whittaker Fri 2/23/2013 4:35 PM Jennifer Whittaker OF Monsters
And Men Coming! Hey Dad, One of my favorite bands, Of Monsters And Men, is coming to the Paramount Theater in May. OMG!!! I WANT to seem them and would LOVE to see them with my concert buddy! ☺ ☺ ☺ ☺ Father and daughter night out (your treat…lucky!) Let me know…, NOW!!!!!!!! ;) TTYL, Jen Message Action Broker + Get More Apps Overview Buy Tickets Seating Chart Maps & Directions Nearby Paramount Theater Sunday, April 2nd Nick Cave Sunday, April 10th Jillian Michaels Wednesday, April 13th Chris Tucker April 16th – April 23rd Black Watch May 1st – May 5th Black Watch Friday, May 11th Russell Peters Tuesday, May 14th Of Monster And Men -
+ Check Traffic + Confirm Reservation + Map + Seating
Chart + Map + Parking -
“Let me clear your schedule & find the best flights
for you.” Alaska Airlines Flight 0864 Depart Seattle Arrive Kahului 11:10 local Depart 7:10 Seattle to San Jose Arrive Kahului 1:30 local. $448.20 Coach $650.30 First Layover Depart 8:05 Seattle Arrive Kahului 11:10 local. $580.40 Coach $940.30 First Depart 9:30 Seattle to SLC Layover Depart 2:00 local to Honolulu $420.20 Coach $550.30 First Layover Arrive Kahului 10:30 local. Depart 4:30 Seattle to SLC Layover Depart 8:00 pm local to Honolulu 『既存の予定を 無くしてみましょう。 フライトの空き状況 はこのようになって います。』 $398.20 Coach $520.30 First Layover Arrive Kahului 6:30 local. Flight Continued -
Alaska Airlines Flight 0864 Depart Seattle Arrive Kahului 11:10 local
Lodging B&Bs on the beach that are pet friendly Hotels your friends have recommended Highest rated hotels All hotels available Matilda’s B&B $125-$255 per night 15174 East Maliki Road, Kahuli, HI 808-437-9422 | Pool, Kids Stay Free… Little Cottage B&B $135-$205 per night 3218 Happy Trails, Kahuli, HI 808-435-8888 | Unique, Private Resort… Maalaea Bay B&B $575-$650 per night 21764 North Bend Lane, Kahuli, HI 808-437-9564 | Private Beach… Seashore B&B $95-$155 per night 2475 Seashore Blvd, Kahuli, HI 808-421-7763 | Pet Friendly, Group Rates… Hilltop B&B $195-$225 per night 1600 Pennsylvania Ave, Kahuli, HI 808-456-1212 | Regal and Elegant… Terrace Views B&B $225-$275 per night 742 Evergreen Terrace, Kahuli, HI 808-437-3221 | Stunning Views of Terraces… Maalea Bay B&B: Sunday May 12 – Saturday May 18 『こちらが おすすめの ホテルです』 -
Alaska Airlines Flight 0864 Depart 8:00a Seattle Arrive Kahului 1:15p
5 Dinning Water Sports Sight Seeing Off the Beaten Path Dinning Off The Beaten Path Sashimi Palace $35-$200 per plate 86458 Grand Avenue, West Kahuli, HI 808-436-5444 | Finest fusion in… Lani’s Steakhouse $65-$105 per plate 76587 Sunset Place, Suite F, Kahuli, HI 808-432-1775 | Laid back atmo… Hurricane Ridge $25-$75 per plate Mon – Sun 11 am to midnight Special rates for children Activities For The Week Zip Line Through The Canopy Mon 2 pm, Tues 2 pm, Fri 10 am, Sat… $55 kids & seniors, $75 adults & students Nighttime Roast On The Beach Tues @ 4, Fri @ 4, Fri @ 6, Sat @ 4, Sat… $99 Family Special, $62 adult, $22 kids Kahului Open Air Market seasonal hours Beginner Scuba Lessons & Rental Mon 1 pm, Tues 1 pm, Fri 11 am, Sat… $55 for your 1st hr/lesson, $25 ea hr after Zip Line 2pm start time Nighttime Roast Family Special 『こちらが おすすめの アクティビティ です。』 Maalea Bay B&B: Sunday May 12 – Saturday May 18 Alaska Airlines Flight 0864 Depart Seattle Arrive Kahului 11:10 local -
『楽しい ご旅行を!』 Luau At The Hotel Early Registration Face Painting
Coupon code THX1138 Snorkeling Lessons Rental Equipment Included Alaska Airlines Flight 8467 Depart Kahului Arrive Seattle 4:10 local Movie Night Kids only Alaska Airlines Flight 0864 Depart 8:00a Seattle Arrive Kahului 1:15p Zip Line 2pm start time Nighttime Roast Family Special Maalea Bay B&B: Sunday May 12 – Saturday May 18 Lani’s With Bob and Nancy -
#azurejp コマンド ライン 何をしたらいいか 教えてください あなたが知らない 言葉を使って ちなみにどんなに わずかでも、 間違いがあれば
すべてのファイルを削除します。 C:¥ -
#azurejp Web サイト がんばってお探しの ものを見つけて ください。 ずっと見ていけば、どこか にあります。 次の Web
サイト でもう一度最初からやり ましょう。 たぶん。 -
#azurejp 女子高生人工知能りんな(LINEアプリ) Bing 検索エンジンで培ったディープラーニング技術+機械学習のクラウドサービス「Azure Machine Learning」を組み合わせた人工知能 Bing チームによる開発(技術開発には Microsoft Research
も参画) 発表以前のテストリリース後、口コミだけで1週間で 35万ユーザーを獲得 ZIP! 8/18 LINE ID:@ms_rinna -
#azurejp Skype SDK 対人間 Office 365 対人間 ルール ベース 自動化
AI Bot Framework Cortana りんな AI、プログラミング と 人 -
#azurejp Web と Smart Phone と Bot UI Communication Auth
Server Build Build None GUI GUI Text Build Build None REST API -
#azurejp 会話を補助するダイアログの例 受付の例 音声⇒テキストデータ テキストデータ⇒音声 顔認証 担当社員への連絡 こんにちは。◦◦株式会社の□□と申します。 本日△△さんと11:00からお約束しております。 返答テキストの作成
会議室予約との照合 自然言語分析 Intent: MTG Entities CompanyName:◦◦株式会社 VisitorName: □□ RequesterName: △△ MeetingDateTime: Today, 11:00 □□様、お待ちしておりました。 ××番の会議室までお越しください。 -
コンタクト システムによるスコアリング テレセールスによる ヒアリングでの優先付け 個別訪問のアレンジ 1 データ解析のスコアリング (優先付け) を 改善できないか?
2 Bot でサポートできないか? AI によるマーケティング施策の案件化 N ot for Sale -
利益最大化 利益最大化 コスト削減 コスト削減 重要案件の見極め精度向上 ビジネス ルール Bot 活用 リードのスコアリング
利益最大化のための戦略 N ot for Sale -
N ot for Sale コールの順番 リードの確度 ビジネス ルール に基づく事前処理 有効な電話番号
有効な電子メール 有効な電話番号 不正確なメールアドレス Name: Daiyu Hatakeyama Email: [email protected] Company: Contoso Phone: 012-345-6789 リード ビジネス ルール Bot 活用 リードのスコアリング -
リードの確度 キャパシティの限界 興味 ありますか? はい! •不採算のリードは処理しない コスト削減 • データに基づいて、 最も重要なリードを優先
利益最大化 ビジネス ルール Bot 活用 リードのスコアリング N ot for Sale -
リードの確度 キャパシティの限界 興味 ありますか? 今はないです 興味 ありますか? はい! •購入の可能性が高いリードを識別 利益最大化
ビジネス ルール Bot 活用 リードのスコアリング N ot for Sale -
リードの確度 キャパシティの限界 興味 ありますか? めちゃくちゃ あります! • 購買の可能性があると予測はしたが、 購買しないと分かったリードは避ける コスト削減
ビジネス ルール Bot 活用 リードのスコアリング N ot for Sale -
リードの確度 キャパシティの限界 興味 ありますか? (応答なし) 興味 ありますか? 今はないです 興味 ありますか?
はい! 興味 ありますか? (応答なし) 興味 ありますか? (応答なし) 興味 ありますか? (応答なし) 興味 ありますか? (応答なし) 興味 ありますか? (応答なし) 興味 ありますか? (応答なし) 興味 ありますか? はい! 興味 ありますか? (応答なし) • 人より低コストで追加対応できる リードは対応する コスト削減 興味 ありますか? (応答なし) • 初期の予測結果にかかわらず、 購入の可能性があるリード 利益最大化 ビジネス ルール Bot 活用 リードのスコアリング N ot for Sale -
#azurejp パターン: メニューの細分化 ユーザーさん、こんにちは! いかがいたしましょうか? イベント ステージ アメニティ どんなイベントに興味が ありますか?
音楽 コメディ 映画 レーザー ドーム スペクタクル 劇場 どんな音楽がお好みですか? (ちなみに、次にアクセスした ときは「音楽イベントを 探しています」と入力すれば、 それに対応します。) ユーザーをガイドする チャネルでは、具体的なメニューやすばやいアクションなどを提供する ボットでできることをユーザーが見つけられるようにする -
#azurejp 2 人分のランチを 予約したい 承知しました! 11:30 と 12:30 に空席が ございます。ご希望の時間枠は?
ヴィーガン用メニューはありますか? -
#azurejp ビルトイン カードの種類 フレームワークでは複数の種類のカードを提供 Node.js .NET リッチ メディアの送信 画像 動画
音声 すべてのチャネルでサポートされているわけではありません チャネルは実装が異なる場合があります チャネルへの "提案" とみなされます -
#azurejp アダプティブ カード オ ー プ ン ソ ー ス
の フ レ ー ム ワ ー ク 複 数 の キ ャ ン バ ス 通知 Microsoft Teams Skype Android iOS -
#azurejp アダプティブ カード ミドル グラウンドへの記入 固定テンプレート 完全制御 柔軟性なし 単調な更新 HTML
キャンバス 一貫性なし 制御なし セキュリティの問題 80% のニーズに対応できる柔軟なペイロード ホストがスタイルとセキュリティの強力な制御を維持 -
#azurejp Star Trek の映 画の楽曲が聞き たいのだけど、ど の映画だったか わすれちゃいまし た。どのイベント でそれをやってい
るのですか? スマートフォンで、 長文入力しますか? 漢字が違う … 「聴く」 漢字にして.. 「忘れる」 -
#azurejp 旅行 Bot Conversational Agent 宿泊予約 飛行機 の予約 ご挨拶 (Hello!)
会員確認 Dialogs/Tasks Parameters (なし) チェックイン日 チェックアウト日 人数 (部屋の種類) 概算見積もり 出発場所 ….. 到着場所 認証 特別オファー 全ての会話には「意図/目的」がある -
#azurejp 画面フロー = 意図のフロー <<App>> EC Hatakeyama Password 認証 検索
購入 Text GUI HoloLens 2 Card Developer ユーザー OK OK ▽ -
#azurejp 画面フロー = 意図のフロー App <<Bot>> 認証 検索 購入 いらっしゃいませ、
畠山さん こんにちは、 畠山といいます。 はい、こちらに。 HoloLens は ありますか? 承りました。 ご利用ありがとう ございました。 2つください。 支払いはカードで。 Developer ユーザー Text Text -
#azurejp 旅行 Bot Conversational Agent 宿泊予約 飛行機 の予約 ご挨拶 (Hello!)
会員確認 Dialogs/Tasks Parameters (なし) チェックイン日 チェックアウト日 人数 (部屋の種類) 概算見積もり 出発場所 ….. 到着場所 認証 特別オファー 分岐をしたい 「埼玉から沖縄まで行きたい」 「1泊1人10,000円までで、 首里城から徒歩圏がいい」 -
#azurejp Conversation 2 Conversation 1 自然言語から、意図とキーワードを抽出 「埼玉から沖縄まで行きたい」 「1泊1人10,000円までで、 首里城から徒歩圏がいい」 LUIS
“Move” “Hotel” “埼玉” “10,000”円 “沖縄” “首里城” “徒歩圏” 意図 = Intent キーワード = Entity 交通検索サービス API ホテル検索サービス API -
#azurejp ナレッジベース Event Bot, Help Desk, FAQ… ユーザーへの質問で情報の絞り込み 全文検索! =
Azure Search! 揺らぎ検索 フィルタリング 自然言語での検索 -
#azurejp LUIS だけを使用しない理由 LUIS が行うこと インテント ユーザーが何をしようとしているか エンティティ値 ユーザーが他にどのようなコンテキストを提供しているか LUIS
が行わないこと データを検証する ユーザーを促す LUIS は検索エンジンではない -
#azurejp Contoso Travel 場所 交通手段 カテゴリ 説明 アラスカ 飛行機、車、 船
自然 野生動物の生息地として有 名であり、冒険好きな人々に 人気の場所である。 カリフォルニア 飛行機、車 自然、都市、 ビーチ さまざまな体験をする ことができる。 ハワイ 飛行機、船 自然、 ビーチ リラックスしたい人々にとって 最適な保養地で ある。 -
#azurejp 検索エクスペリエンスを実現する機能 エクスペリエンスの実現に必要となる検索のすべての要素 キーワード検索、ファセット、サジェスト/オートコンプリート、強調表示など フィルター、並べ替え、およびランク付けに対応する地理空間サポート 柔軟なデータ取り込みオプション プッシュ: あらゆる場所、オンプレミス/クラウド、任意のストアからデータを取り込む プル: DocumentDB、SQL
DB、BLOB ストレージ、テーブル ストレージの組み込みサポート ドキュメント クラッキングのサポート (PDF、Office、JSON、HTML など) グローバルな提供、柔軟な容量 ワークロードの需要の変化に合わせて容量を動的に調整 世界の 14 地域で提供 -
#azurejp Azure Search の検索の動き QueryParser Search Engine Analyzer IndexWriter インデックス
Simple lucene Analyzed terms Query terms Query tree Query text Documents terms Analyzed terms Retrieve Ingest Analyzer ドキュメント 検索処理 • クエリーを元にトークン 引き当て • ランキング処理 クエリ文を解析し内部 クエリ―形式に変換 テキスト解析を行いトークンの展開、 変換、削除などを行う 転置インデックス インデックス生成処理 -
#azurejp searchとfilterのクエリ評価順序 フィルタで絞り込こまれた結果に対してサーチクエリを実行 filter処理 search処理 クエリ 結果 クエリ評価 絞り込み 全文検索
+ スコアリング処理 /<インデックス名>/docs?... &$filter=session eq ‘DEV‘ &search=Azure Session: DEV Title: Azure … Session: DEV Title: Cloud … Session: OPS Title: Azure ... Session: DEV Title: Azure … Session: DEV Title: Cloud … Session: DEV Title: Azure … … -
#azurejp QnA Bot – Azure Search インデックス例 { "name": "qnakb",
"fields": [ { "name":"id", "type":"Edm.String", "key":true, "searchable":false, "filterable":false, "sortable":false, "facetable":false }, { "name":"question", "type":"Edm.String", "searchable":true, "filterable":false, "sortable":false, "facetable":false,"analyzer":“ja.lucene"}, { "name":"answer", "type":"Edm.String", "searchable":true, "filterable":false, "sortable":false, "facetable":false,"analyzer":"ja.lucene"}, { "name":"category", "type":"Edm.String", "searchable":false, "filterable":true, "sortable":true, "facetable":true }, { "name":"url", "type":"Edm.String", "searchable":false, "filterable":false, "sortable":false, "facetable":false }, { "name":"tags", "type":"Collection(Edm.String)", "searchable":false, "filterable":true, "sortable":false, "facetable":false } ], … } question, answer フィールド は searchable -
#azurejp QnA Bot – 重みづけとクエリ例 クエリパラメータ スコアリングプロファイル フィールドウェイトをquestionとanswerが9対1で設定 { "fields":
[…], "scoringProfiles": [ { "name": "weightedFields", "text": { "weights": { "question": 9, "answer": 1 } } } ] } & searchMode=any & queryType=full & search=“キーワード” & scoringProfile=weightedFields ( & $filter=category eq ‘カテゴリ’ ) • 特定フィールドに絞る場合は フィールドスコープ指定 (question:キーワード) • ここではanswerフィールドを 考慮するため指定しない カテゴリ絞りをする場合 スコアリングのフィールドウェイトを question を 9 に対して answer に1を設定 -
#azurejp 人間へのハンドオフ ボットから人間への管理されたハンドオフ これらの手順をすべて試したのですが、コンピューターの 電源がまだ入りません。 すばらしい。ありがとうございます。 ハードウェア サービスのリクエストをご提案します。サービス エンジニアに、お客様のコンピューターを確認させることができます。 オペレーターへの注意:
ユーザーはハードウェアの交換が 必要のようです。次のステップはなんですか ? ユーザーへの 謝罪 ハードウェア サービスの提案 自分で入力 -
#azurejp { Your Code } Intelligence Cognitive Services Tools Bot
Framework HTTP REST Endpoint Services Bot Service Cortana Others Facebook Skype Conversational and Business logic Development tools Bot とは? -
#azurejp ボット Web サービス あなたの ボット コード ボット コネクター サービス
メッセージの入力 <> 出力 状態管理 その他のサービス、API、 データベース、 Azure Machine Learning、 Azure Search など… Bot Builder SDK エンティティ 抽出 音声認識 画像/顔認識 自然言語 翻訳 + Microsoft Cognitive Services 検索 感情検出 Knowledge API … 会話キャンバス/チャネル … … … Web チャット Direct Line… メール Facebook GroupMe Kik Skype Slack Telegram Twilio (SMS) Bot Builder SDK ボット コード 典型的なボットのしくみ -
#azurejp Microsoft Bot Framework Bot Developer SDKs Bot Connector Bot
Directory ダイアログ形式の コミュニケーションを実装 (C#, Node.js) BOT アプリをメッセージング サービスに接続 Bing, Cortana などから利用 できるディレクトリに登録 BOT アプリを容易に作成するフレームワーク https://dev.botframework.com/ -
#azurejp Bot Builder SDKs Node.js & C# SDK ダイアログを容易に実装 ユーザー、セッション、ユーザー+
セッションごとにステート管理 Built-in ダイアログ: Yes/No, String, Number, Choices Natural language understanding (LUIS) Form slot filling (branching, disambiguation, multi-turn) Profile (e.g., home address) -
#azurejp Bot Framework Channel Emulator ローカル環境(Windows)で Bot を動作確認するためのエミュレータ Mac /
Linux 向けに コマンドラインベースのエミュレータも公開 -
#azurejp Bot Framework の開発環境、ドキュメント 開発ツール C# (.NET) : Visual Studio
2015 (* Visual Studio Community 2015(無償) 可) Note.js : コーディングツール (Visual Studio Code 等) 他開発環境 Bot Framework Template (C#) http://aka.ms/bf-bc-vstemplate Bot Framework Emulator (Win/Mac/Linux) https://aka.ms/bf-bc-emulator Bot Builder SDK https://github.com/Microsoft/botbuilder 開発ドキュメント Microsoft Bot Framework Documentation https://docs.botframework.com/en-us/node/builder/overview/ -
#azurejp Dialogの操作順序 MesseagesControllerからDialog を呼び出す await Conversation.SendAsync(activity, () => new FlightDialog());
StartAsyncが必ず呼ばれるので、 次の入力を待機するMethodを指定 context.Wait(AskOrigin); 他のDialog呼び出しも可能 context.Call(new HotelDialog(), <Callback関数名>); Dialogの終了 context.done<object>(<Callback関数で受け取る情報>) -
#azurejp Bot State Service Bot に対するユーザ入力を格納する領域を提供 ※Web アプリの Session に相当する概念です
# データのセット BotData userData = await activity.GetStateClient().BotState.GetUserDataAsync(activity.ChannelId, activity.From.Id); userData.SetProperty<int>("AuthProcess", 0); # セットしたデータの取得 BotData userData = await stateClient.BotState.GetUserDataAsync(activity.ChannelId, activity.From.Id); -
#azurejp LuisDialog LUIS と連携 [LuisModel("78685ddf-f144-4a10-9840-xxxxxxxxxxxx", "0fc3f088e3ab402f822fxxxxxxxxxxxx")] [Serializable] class HelpDeskOrderDialog :
LuisDialog<HelpDeskOrder> { [LuisIntent("")] public async Task None(IDialogContext context, LuisResult result) { await context.PostAsync("I'm sorry, I didn't understand you."); context.Wait(MessageReceived); } [LuisIntent("InstallSoftware")] public async Task ProcessInsallSoftware(IDialogContext context, LuisResult result) { string software = result.Entities[0].Entity; await context.PostAsync($"So, you want to install {software}. I will put your request into the system. "); context.Wait(MessageReceived); } … } LUIS が発行するID LUISのIntentが “InsallSoftware” に マッチした際に呼ばれる -
#azurejp Luis を利用した Bot 作成に必要なステップ 115 https://dev.botframework.com/ で自身の Bot 情報を登録
Bot Framework アプリの開発 Luis を使う? App Service 等に Bot アプリを デプロイ https://www.luis.ai/ でアカウント登録 https://dev.botframework.com/ で Skype 等に Bot を公開 https://www.luis.ai/ でモデル学習 -
#azurejp Dialog からの FormFlow の呼び出し(1/3) ユーザ入力を LuisDialog で Intent に対応付けし、
FormFlow でユーザ入力 を促す -
#azurejp Your conversation logic 作成する Bot Bot Builder SDK (Node.js
/ C#) LUIS Dialog からの FormFlow の呼び出し(2/3) LuisDialog でユーザ入力を Intent に対してマッピングし、 各 Intent 内のメソッドから FormFlow へ処理を移譲 LuisDialog FormFlow1 FormFlow2 FormFlow3 Web Service Social Media DB Access -
#azurejp Dialog からの FormFlow の呼び出し(3/3) Dialog クラス内で IDialogStack.Call メソッドを利用し、 FormFlow
側に処理を移譲 [LuisIntent("GetProductInfo")] public async Task ProcessMSProductForm(IDialogContext context, LuisResult result) { var entity = result.Entities.FirstOrDefault(); var productForm = new FormDialog<MyProduct>(new MyProduct(), MyProduct.BuildMyProductForm, FormOptions.PromptInStart, new List<EntityRecommendation>(result.Entities)); context.Call<MSProduct>(productForm, MyProdcutFormComplete); } ※参考 https://github.com/Microsoft/BotBuilder/blob/master/CSharp/Samples/PizzaBot/PizzaOrderDialog.cs -
#azurejp FormFlow を Json ファイルから作成したい (2/2) Json 形式のファイルを作成し C# 等から呼び出し
{ "References": [ "MyJsonFormBotApp.dll" ], "type": "object", "required": [ "AzureService", "Term" ], "Templates": { "NotUnderstood": { "Patterns": [ "悪いけど「¥"{0}¥"」だと何を言っているのか分からないです。", " もう一回試してもらっていいですか?" ] } }, "properties": { "AzureService": { "Prompt": { "Patterns": [ "どの {&} が好きですか? {||}" ] }, "Before": [ { "Message": [ "Microsoft Azure アンケート回収 Bot へようこ そ!" ] } ], "Describe": { "Image": "https://www.p2vsystems.com/wp- content/uploads/2016/09/ms-azure.png" }, "type": [ "string", "null" ( 中略 ) internal static IDialog<JObject> MakeRootDialog() { return Chain.From(() => FormDialog.FromForm(BuildJsonForm)); } public static IForm<JObject> BuildJsonForm() { using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("M yJsonFormBotApp.MyJsonForm.json")) { var schema = JObject.Parse(new StreamReader(stream).ReadToEnd()); return new FormBuilderJson(schema) .AddRemainingFields() .Build(); } } -
#azurejp SecretaryBot アーキテクチャ SQL Database ユーザー情報保存 Office 365 APIで365と連携 Azure
Web Apps Botをホスト Application Insights 利用状況分析 -
#azurejp Microsoft Graph 概要 Office 365 はMicrosoft Graph APIで操作可能 USERS
FILES MAIL CALENDAR TASKS GROUPS Microsoft Graph API (graph.microsoft.com) 関係性や知見を収集 -
#azurejp Microsoft Graph 概要 セキュアでシンプルなAPI呼び出し Azure Active Directory (AD) 認証/認可
REST API/データ取得 アプリ Microsoft Graph -
#azurejp Microsoft Graph API 一例 指定したユーザー同士の空き時間を取得する POST https://graph.microsoft.com/v1.0/me/findMeetingTimes 関連の高いユーザーを取得する GET
https://graph.microsoft.com/beta/me/people -
#azurejp Office 365/Dynamics 365 の連携方法 Office 365 と Bot の連携方法
(サンプルあり) https://aka.ms/aadbot https://aka.ms/o365bot Dynamics 365 と Bot の連携サンプル https://github.com/keijiinoue/CRM-Bot-Sample -
#azurejp Using speech in bots Building a bot for a
speech-enabled channel Today: Cortana, Direct Line, Web Chat Cortana is a new channel for bots Construct bot messages that specify the text to be spoken Don’t necessarily read out loud everything displayed by the bot Speak with plain text or SSML markup Activity reply = activity.CreateReply("This is the text that will be displayed."); reply.Speak = "This is the text that will be spoken."; reply.InputHint = InputHints.AcceptingInput; await connector.Conversations.ReplyToActivityAsync(reply); -
#azurejp Anti-pattern: Canvas/input mismatch Speech is not the best approach
for all bot scenarios -
#azurejp How do Cortana Skills Work? Developers Cortana Bot Framework
Messaging Endpoint Register endpoints and metadata Build and deploy End Users Hold conversations Invokes on request -
#azurejp Creating a Great Skill from Scratch The Bot Framework
enables deep integration with Cortana’s experiences. Create your skill logic using the Bot Framework • Build a bot using the Bot Builder SDK • Use Cognitive Services (LUIS) for natural language understanding Add the Cortana channel • Register your bot as a Cortana skill • Configure Cortana- specific data and features Publish your skill • Make your skill discoverable by all Cortana users -
#azurejp Adding the Cortana Channel Allows bots to… Utilize Cortana’s
UX to interact with users Request user data to customize experiences Note that this data is only passed with user consent Interact with end users verbally Depend on Cortana to manage user identity Launch client code on the user’s active machine -
#azurejp Using Speech for Holographic Bots HoloBot Open Source Project
https://github.com/ActiveNick/HoloBot Custom HoloLens channel built with Direct Line API Works with any bot built Microsoft Bot Framework (Node or .NET) Upcoming Merck Technical Case Study https://aka.ms/merckholobot (not live yet!) -
#azurejp 可能な限りの情報を提示 思考 表現手段 表情 声 振舞 感情 情報、データ 文字
図 会う 音声電話 手紙/メール App 意図 (5W1H) -
#azurejp Microsoft Cognitive Services Web API 経由で利用できる “人工知能パーツ” 画像/ビデオの 読解/顔識別/
感情判別/OCR 話者識別 音声⇔テキスト 文章解析 文意文脈理解 Web/学術情報 ビックデータ解析 Bing による検索 表現手段をコンピューターに伝える -
#azurejp 人にやさしいシステムに 思考 表現手段 表情 声 振舞 感情 情報、データ 文字
図 Conversation as a Platform 意図 (5W1H) -
#azurejp 会話を補助するダイアログの例 受付の例 音声⇒テキストデータ テキストデータ⇒音声 顔認証 担当社員への連絡 こんにちは。◦◦株式会社の□□と申します。 本日△△さんと11:00からお約束しております。 返答テキストの作成
会議室予約との照合 自然言語分析 Intent: MTG Entities CompanyName:◦◦株式会社 VisitorName: □□ RequesterName: △△ MeetingDateTime: Today, 11:00 □□様、お待ちしておりました。 ××番の会議室までお越しください。 -
#azurejp パーソナルアシスタント (Cortana) チャットボット (BOT Framework) 機械学習と開発環境 (Azure Machine Learning
Studio) 深層学習フレームワーク (Cognitive Toolkit) 認識API (Cognitive Services) 翻訳API (Microsoft Translator) AI の民主化 -
#azurejp © 2016 Microsoft Corporation. All rights reserved. Microsoft, Windows,
Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. -
#azurejp 開発者向け情報リソース Cognitive Services & Bot Framework ハンズオン 人工知能パーツ Microsoft
Cognitive Services を使った表情分析アプリを作ろ う! Emotion API × Bot Framework http://aka.ms/cogbot01_HOL1 Emotion API × JavaScript http://aka.ms/cogbot01_HOL2 Microsoft Bot Framework v3.0 からはじめる BOT 開発 http://qiita.com/annie/items/edc26c0ee9603e84a2e4 LUIS を試してみよう http://beachside.hatenablog.com/entry/2016/11/21/010051 Microsoft Flow と Cognitive Services Text Analytics、Power BI で Tweet テ キスト分析レポート http://qiita.com/annie/items/af481a7a8d4aac4e0fd9 -
#azurejp Bot Framework サンプル Bot Framework Template for Visual Studio
http://aka.ms/bf-bc-vstemplate Bot Framework Samples in GitHub https://github.com/Microsoft/BotBuilder The Maker Show Bot https://github.com/ActiveNick/TheMakerShowBot Stock Bot and others https://github.com/Microsoft/BotBuilder/tree/master/CSharp/Sam ples/Stock_Bot -
#azurejp Bot Framework 学習リソース Bot Framework Home Page https://dev.botframework.com/ Bot
Builder SDK on GitHub https://github.com/Microsoft/BotBuilder Bot Framework Blog https://blog.botframework.com/ //Build Reaction - Cortana and the Bot Framework https://channel9.msdn.com/Blogs/raw-tech/Build-Reaction-Cortana-and-the-Bot-Framework Cloud Cover Ep. 206: Bot Framework with Mike Hall https://channel9.msdn.com/Shows/Cloud+Cover/Episode-206-Bot-Framework-with-Mike-Hall -
#azurejp Cognitive Services 開発情報 開発ツール Visual Studio 2015 * Visual
Studio Community 2015 (無償) 可 Cognitive Services (旧: Project Oxford) Client SDK & Samples https://github.com/Microsoft/ProjectOxford-clientsdk 開発ドキュメント Microsoft Cognitive Services > Documentation https://www.microsoft.com/cognitive-services/en-us/documentation Microsoft Cognitive Services APIs https://dev.projectoxford.ai/docs/services/ https://bingapis.portal.azure-api.net/docs/services/ -
#azurejp Cognitive Services 関連コミュニティ CogBot コミュニティ Cognitive Services & Bot
Framework www.facebook.com/groups/cogbot cogbot.connpass.com #cogbot