Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
用 Python + Azure 建立你的聊天機器人
Search
Andy Dai
August 27, 2016
Programming
2
480
用 Python + Azure 建立你的聊天機器人
Andy Dai
August 27, 2016
Tweet
Share
More Decks by Andy Dai
See All by Andy Dai
Analyzing Chinese Lyrics with Python
daikeren
4
1.2k
Other Decks in Programming
See All in Programming
振り返れば奴(Cline)がいる
keiyagi
0
150
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
310
ファインディの テックブログ爆誕までの軌跡
starfish719
1
840
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
240
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
10
1.7k
SpringBoot3.4の構造化ログ #kanjava
irof
2
850
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
1
540
サーバーゆる勉強会 DBMS の仕組み編
kj455
1
370
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
150
asdf-ecspresso作って 友達が増えた話 / Fujiwara Tech Conference 2025
koluku
0
2.5k
Azure AI Foundryのご紹介
qt_luigi
1
270
AWS Organizations で実現する、 マルチ AWS アカウントのルートユーザー管理からの脱却
atpons
0
110
Featured
See All Featured
How to Ace a Technical Interview
jacobian
276
23k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
How to train your dragon (web standard)
notwaldorf
90
5.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
20
2.4k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Code Reviewing Like a Champion
maltzj
521
39k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
990
BBQ
matthewcrist
86
9.4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Become a Pro
speakerdeck
PRO
26
5.1k
A Modern Web Designer's Workflow
chriscoyier
693
190k
What's in a price? How to price your products and services
michaelherold
244
12k
Transcript
አ Python + Azure ୌ 缏֦ጱ肗ॠ秚瑊Ո Andy Dai
[email protected]
1
ᛔ౯Օ奧 • Andy Dai • Organizer of Taipei.py • PyCon
பૡ (2012~) • 犋䨝狶獮ᒒጱૡ纷䒍 @GliaCloud 2
Agenda • Introduction to ChatBot • BotFramework • LUIS •
Recap 3
4
य़ Bot 碻դ 5
10000+ CHATBOTS 6
BOTs are the new APPs 7
肗ॠ秚瑊Ո(CHATBOT) ౯మᥝತݣ玖敋ᒊᴫ蜱犋褖碻ጱ߅珹記 ֦অ牧౯ݢ犥䒻֦犚綍讕珌牫 অጱ牧讔簡䒻౯懪犡ॠӥ܌獋讨 2 ֖ ౯വ萃 OOXX Cafe 襑ᥝ䒻眅懪֖㻟
8
CHATBOT 礍䯤墋Օ ChatBot Interface Web Service Business Logic Natural Language
Understanding User Status External Service THE CORE OF YOUR BOT 9
Microsoft Bot Framework • 犡ଙӣ์朰ڊ • ඪൔଘݣ • Skype •
Facebook • Telegram • Slack 10
BotBuilder SDK • BotFramework ChatBot Interface Web Service Business Logic
Natural Language Understanding User Status External Service • LUIS (Language Understanding Intelligence Service) 11
Open Source SDK. But… 12
C# & Node.js Only :( 13
౯మᥝአ Python ! 14
Why Python? • Daily Job - ਁ蒂ቘ牏CSV/XLS牏粖翕殷 • Web -
Django, Flask • DevOps - Ansible, SaltStack, OpenStack • Ӟ犚盄ᄤጱԪ眐 (Deep Learning, Machine Learning, Natural Language Processing, …) • 螭磪ๅग़䛑አ (Raspberry Pi, ᇔቘ秇硈, 䌃 APP ) 15
IEEE Spectrum ranking 16
ᛔ૩ጱ SDK ᛔ૩䌃 17
BotFramework • ࣁ https://dev.botframework.com/ 戢㲘 • 玲 Client ID &
Client Secret 18
19
20
BotFramework REST API • Authentication • Bot Connecter REST API
• Bot State REST API 21
Authentication 22
pip install requests Requests: HTTP for Humans 23
Authentication import requests def get_token(client_id, client_secret): payload = { 'grant_type':
"client_credentials", 'client_id': client_id, 'client_secret': client_secret, 'scope': "https://graph.microsoft.com/.default", } response = requests.post(AUTH_URL, data=payload) token = response.json()['access_token'] return token 24
犋ੜஞ疰Ӟ粚ݢ犥㵕 ጱ SDK ೪蕕ਠԧ... 25
pip install pybotbuilder 26
DEMO - Echo Bot 27
LUIS • Language Understanding Intelligence Service • 墋㻌㬵藯疰ฎ虏襎脲啻薹Ո觊承ࣁ拻ࠨ 28
᯿ᥝݷ扃薹朰 • Intent • 瑽 • ex. 疨ತ߅珹皣牏扇㺔籧禂碻樌 • Entity
• 䋿誢殻ፓ • ex. ֖ᗝ牏碻樌 29
Example • ֺݙ物౯మತݣ玖敋ᒊᴫ蜱磪矠ଷጱ߅珹皣 • Intent: 疨ತ߅珹皣 • Entity: ݣ玖敋ᒊҁ֖ᗝ҂牏磪矠ଷҁ襑穩҂ 30
獺ୌ APP 31
New Entity 32
New Intent 33
秂懿 34
介手 35
Intent 36
Entity 37
磪Ո䌃অ Python Package ԧ pip install luis 38
DEMO 39
碉ݳࣁӞ蚏 • ತ߅珹皣秚瑊Ո • Django + pybotbuilder + luis •
䌃ጱ code 犋᩻螂 200 ᤈ 40
DEMO 41
Recap • አ Python 犖ݢ犥ֵአ BotFramework • LUIS is easy
• Life is short, you need Python 42
Reference • https://github.com/daikeren/pyBotBuilder • https://blogs.msdn.microsoft.com/tsmatsuz/ 2016/08/19/build-skype-bot-with-microsoft-bot- framework-oauth-and-rest-api/ • https://docs.botframework.com/ •
https://www.luis.ai/Help/ 43
ૡ珶๐率 - Taipei.py • ݣ傀磧य़ጱ Python ᐒᗭ • ྯ㮆์盄ग़ၚ㵕 (Talk,
Sprint, 碝ಋ, …) 44
ૡ珶๐率 - Taipei.py 45
THANK YOU
[email protected]
/ 886 2 2752 8851 Unit.3, 11F.,
No.48, Fuxing N.Rd., Zhongshan Dist., Taipei City 104, Taiwan