ithome chatbot day: 透過 golang 無痛建置機器學習聊天機器人

42
透過 Golang 無痛建置機器學習聊 天機器人 Evan Lin @ Linker Networks

Upload: evan-lin

Post on 22-Jan-2018

201 views

Category:

Internet


14 download

TRANSCRIPT

Page 1: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

透過 Golang 無痛建置機器學習聊天機器人

Evan Lin @ Linker Networks

Page 2: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

About Me• Cloud Architect @ Linker

Networks

• Golang User Group - Co-Organizer

• Top 5 Taiwan Golang open source contributor (github award)

• Developer, Curator, Blogger

Page 3: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Three chatbots

Page 4: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

First: Build a line chatbot within 3 minutes

Page 5: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

How to choose programming language for Chat Bot?

• Easy to Write

• Fast in Run and Compile

• Powerful Concurrency

• Powerful Built-in Toolchain

Page 6: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Go Go Powe Ranger

Page 7: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Line Message API

Page 8: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Deploy Line Bot …. Just one click

https://github.com/kkdai/LineBotTemplate

Page 9: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Let’s Demo ….. on video

Page 10: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

How to deploy Line Bot in 3 minutes

Page 11: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Ok! How can I modify code

Page 12: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

PetNeedMe: 流浪動物領養Line機器人

Page 13: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Second: Build a line chatbot with LUIS.AI

Page 14: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

What is LUIS.AI

Page 15: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Language Understanding Intelligent

台北天氣如何?台北冷

嗎?

台北天

氣好嗎

?

台北天氣怎

麼樣?

台北天空是

什麼顏色?

台北有下雨嗎?

去台北需要帶傘嗎?

Page 16: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

LUIS: Intent and Entity

台北天氣如何?Intent: Check Weather

Entity: Taipei

Page 17: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

LUIS SDKs

Go Version ???

Page 18: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

LUIS Go package

Page 19: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Baby LUIS Chatbot

Page 20: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Total intents

Page 21: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

How to train your baby (chatbot)

Input syntax

Response related activity

Display related intent

Remember selection and train

NO

YES

Has Chatbot Learn it?

Page 22: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

How to train your baby (chatbot)

Input syntax

Response related activity

Display related intent

Remember selection and train

NO

YES

Has Chatbot Learn it?

Page 23: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Daddy, I have learned!

Github: LUIS Go package https://github.com/kkdai/luis Line baby LUIS https://github.com/kkdai/LineBotBabyLuis

Page 24: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Final: Build a line chatbot with deep learning - Tensorflow

Page 25: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Tensroflow Inception Model Graph

Page 26: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

It is so hard to be a data scientist …. until ...

Page 27: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

You got some great books

Page 28: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Or .. you have learn some great courses..

Page 29: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Data Collect Probe & Sensor & Smart GW

Vizualization

Data Process

Data Analysis &Machine Learning DC/OS Spark ML Tensorflow

DC/OS

StorageCassandra

Kafka (Queueing)

Go/Akka (Connector)

Spark (ETL/Streaming)

D3.js

Scikit Learn R

Interactive Dashboard

Jupyter Notebook

Zeppelin

ML Job Scheduler Chronos

HPC (with GPU) server

Storage SDNStorage SDN

Machine Learning Data Flow

Page 30: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Serving Pre-build Models (1)

Page 31: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Serving Pre-build Models (2)

Image Serve image to inception model

Predict resultResponse result

github: https://github.com/kkdai/LineBotAnimal github: https://github.com/kkdai/tf-go-inception

Page 32: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Let’s ask about some animal

Page 33: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Even more...

Page 34: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Lots of models here ..

Page 35: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Other tensorflow models (1)

https://github.com/tensorflow/models/tree/master/im2txt

Page 36: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Other tensorflow models (2)

https://github.com/tensorflow/models/tree/master/transformer

Page 37: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Don’t let your imaginations limits you

Refer: http://www.butterlion.com.tw/

Page 38: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

歡迎訂閱 碼天狗

http://weekly.codetengu.com/

Page 40: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

iThome Gopher Day 2017/06/29 北科大集思中心 (Call for speaker)

Page 41: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Linker is hiring

Cloud Platform Engineer- Kubernetes, DCOS- Golang- DevOps

Page 42: iThome Chatbot Day: 透過 Golang 無痛建置機器學習聊天機器人

Live Demo