SlideShare a Scribd company logo
1 of 32
Download to read offline
用 Hugging Face 來做 Chatbot
Building Chatbot With Huggging Face
Ko Ko, Microsoft AI MVP
2023/07/29 開源人年會 @台灣科技大學
關於 Ko Ko
● 叫我 Ko Ko 或是科科。
● 連續四年當選 Microsoft AI MVP。
● 國內外大型技術年會講師,包含 COSCUP、ModernWeb、名古屋開源年會、香港
開源年會、PyCon APAC、PyCon HK、DevDays Asia 等等的活動。
● 合著有『駕馭 ChatGPT 4: 探索 Azure OpenAI 與 Cognitive Service for Language
開發實踐 (使用.NET 與 Node.js)』
● https://linktr.ee/qqkerk
大綱
1. Hugging Face 介紹
2. 快速部署 Hugging Face 模型
3. 串接到 LINE 的步驟
Hugging Face
Hugging Face 是一家專注於自然語言處理(NLP)公司。
最知名的是「Transformers」的 Python 套件,讓開發者輕鬆使用先進的語言模型進行
NLP 任務。
用戶可以在其中找到並分享各種 NLP 模型,很多都是開源的。
Hugging Face 的目標是讓 NLP 技術更容易使用和應用,推動 NLP 在學術、商業和個
人領域的普及。
Transformer
2017 年 Google 發表了「Attention Is All You Need」。
此後,Transformer 幾乎一統天下。
Hugging Face 與三大神器
開發環境
有 GPU 是最好的!!
Google Colab
Kaggle Notebooks
AWS Sage Maker
Azure Machine Learning
Live Demo
1、導覽 Hugging Face
2、在 Azure Machine Learning 上部署 model
Live Demo 重點
了解 Hugging Face Hub 網站的內容,包含了 models,datasets,spaces,tasks等。
了解 Hugging Face 做自然語言處理的容易程度。
了解使用 Azure Machine Learnging 部署模型的優勢和劣勢。
如果要部署 Llama 2 ......
用最小的 Llama 2 7b-chat
NC12s_V3
12 Core,224 GB RAM,672 GB HDD
每小時 6.12 美元。
LINE Chatbot 架構
建立 Privoder
建立 Channel
選 Massage API 並填入資訊
拿到 Secret
拿到 Access token
使用 LINE Python SDK
https://github.com/line/line-bot-sdk-python
handler 寫法
@handler.add(MessageEvent, message=TextMessage)
def handle_message(event):
line_bot_api.reply_message(
event.reply_token,
TextSendMessage(text=event.message.text + " Handler"))
handler 寫法
@handler.add(MessageEvent, message=TextMessage)
def handle_message(event):
line_bot_api.reply_message(
event.reply_token,
TextSendMessage(text=event.message.text + " Handler"))
用 Django 來串接 LINE
https://www.youtube.com/watch?v=4V34CKV82sA
鐵人賽 30 篇 Hugging Face 連載
繁體中文最完整的教學文件之一
從環境設定一路教到部署成為聊天機器人
未來的學習 roadmap 也都教給你
https://ithelp.ithome.com.tw/users/20120030/
ironman/5515
鐵人賽 30 篇 Azure Machine Learning 連載
繁體中文最完整的教學文件之一
從環境設定一路教到把 AI 部署為 web API
MLOps 也有教
https://ithelp.ithome.com.tw/users/20120030/
ironman/4905
工商一下
第一本針對軟體工程師所撰寫之 ChatGPT 專書
用 .NET 和 Node.JS 雙語言範例程式碼
第一本針對 Azure OpenAI 所撰寫之專書
第一本針對 Cognitive Service for Language 專書
第一本教你如何 Fine tune GPT 模型之專書
第一本教你 Semantic Kernel 與 RAG pattern 專書
大量範例與實戰,連最新的 Bring your own data 都有
天瓏書局目前月銷售排行第二名
500元折扣碼:KOKO0825
注意上面的折扣碼是兩個英文 O 和數字零
http://s.accupass.com/gVbZ0C
https://gai-2023.alphacamp.co/
謝謝大家
Q&A

More Related Content

Similar to Building Chatbot With Huggging Face

ML.NET 在遷移式學習的應用與挑戰
ML.NET 在遷移式學習的應用與挑戰ML.NET 在遷移式學習的應用與挑戰
ML.NET 在遷移式學習的應用與挑戰Ko Ko
 
Bot framework composer---用圖形化介面來建立聊天機器人
Bot framework composer---用圖形化介面來建立聊天機器人Bot framework composer---用圖形化介面來建立聊天機器人
Bot framework composer---用圖形化介面來建立聊天機器人Ko Ko
 
程式交易面面觀
程式交易面面觀程式交易面面觀
程式交易面面觀Philip Zheng
 
如何使用微軟Power系列服務的看法
如何使用微軟Power系列服務的看法如何使用微軟Power系列服務的看法
如何使用微軟Power系列服務的看法Edward Kuo
 
認識程式交易
認識程式交易認識程式交易
認識程式交易Philip Zheng
 
容器式高效率 ChatBot 開發方法
容器式高效率 ChatBot 開發方法容器式高效率 ChatBot 開發方法
容器式高效率 ChatBot 開發方法Philip Zheng
 
How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015Macpaul Lin
 
理財機器人技術簡介與實作經驗分享
理財機器人技術簡介與實作經驗分享理財機器人技術簡介與實作經驗分享
理財機器人技術簡介與實作經驗分享Philip Zheng
 
极速 Angular 开发:效能调校技巧 (ngChina 2019)
极速 Angular 开发:效能调校技巧 (ngChina 2019)极速 Angular 开发:效能调校技巧 (ngChina 2019)
极速 Angular 开发:效能调校技巧 (ngChina 2019)Will Huang
 
Trading bot演算法與軟工在程式交易上的實踐
Trading bot演算法與軟工在程式交易上的實踐Trading bot演算法與軟工在程式交易上的實踐
Trading bot演算法與軟工在程式交易上的實踐Philip Zheng
 
Agile tour 2014 - Coding Dojo with C# and TDD
Agile tour 2014 - Coding Dojo with C# and TDDAgile tour 2014 - Coding Dojo with C# and TDD
Agile tour 2014 - Coding Dojo with C# and TDDAgileCommunity
 
Agile tour Taipei 2014 - coding dojo with CSharp and TDD
Agile tour Taipei 2014 - coding dojo with CSharp and TDDAgile tour Taipei 2014 - coding dojo with CSharp and TDD
Agile tour Taipei 2014 - coding dojo with CSharp and TDDJoey Chen
 
Bot Framework 和它的快樂夥伴Composer
Bot Framework 和它的快樂夥伴ComposerBot Framework 和它的快樂夥伴Composer
Bot Framework 和它的快樂夥伴ComposerKo Ko
 
理財機器人技術簡介與實作經驗分享
理財機器人技術簡介與實作經驗分享理財機器人技術簡介與實作經驗分享
理財機器人技術簡介與實作經驗分享Philip Zheng
 
來玩 Bot Framework Composer 2.0版吧!
來玩 Bot Framework Composer 2.0版吧!來玩 Bot Framework Composer 2.0版吧!
來玩 Bot Framework Composer 2.0版吧!Ko Ko
 
Mochimedia's Success Story - Case Study I (Python-based Company)
Mochimedia's Success Story - Case Study I (Python-based Company)Mochimedia's Success Story - Case Study I (Python-based Company)
Mochimedia's Success Story - Case Study I (Python-based Company)Sting Chen
 
Langchain and Azure ML and Open AI
Langchain and Azure ML and Open AILangchain and Azure ML and Open AI
Langchain and Azure ML and Open AIKo Ko
 
初探程式語言設計以C#為例
初探程式語言設計以C#為例初探程式語言設計以C#為例
初探程式語言設計以C#為例Johnson Gau
 
聊天機器人概論 Introduce to chat bot sevices
聊天機器人概論 Introduce to chat bot sevices聊天機器人概論 Introduce to chat bot sevices
聊天機器人概論 Introduce to chat bot sevicesDuran Hsieh
 
業界都在用的自然語言理解工具,教你快速建構Line對話機器人
業界都在用的自然語言理解工具,教你快速建構Line對話機器人業界都在用的自然語言理解工具,教你快速建構Line對話機器人
業界都在用的自然語言理解工具,教你快速建構Line對話機器人Ko Ko
 

Similar to Building Chatbot With Huggging Face (20)

ML.NET 在遷移式學習的應用與挑戰
ML.NET 在遷移式學習的應用與挑戰ML.NET 在遷移式學習的應用與挑戰
ML.NET 在遷移式學習的應用與挑戰
 
Bot framework composer---用圖形化介面來建立聊天機器人
Bot framework composer---用圖形化介面來建立聊天機器人Bot framework composer---用圖形化介面來建立聊天機器人
Bot framework composer---用圖形化介面來建立聊天機器人
 
程式交易面面觀
程式交易面面觀程式交易面面觀
程式交易面面觀
 
如何使用微軟Power系列服務的看法
如何使用微軟Power系列服務的看法如何使用微軟Power系列服務的看法
如何使用微軟Power系列服務的看法
 
認識程式交易
認識程式交易認識程式交易
認識程式交易
 
容器式高效率 ChatBot 開發方法
容器式高效率 ChatBot 開發方法容器式高效率 ChatBot 開發方法
容器式高效率 ChatBot 開發方法
 
How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015How to build a community in a company blue&macpaul coscup2015
How to build a community in a company blue&macpaul coscup2015
 
理財機器人技術簡介與實作經驗分享
理財機器人技術簡介與實作經驗分享理財機器人技術簡介與實作經驗分享
理財機器人技術簡介與實作經驗分享
 
极速 Angular 开发:效能调校技巧 (ngChina 2019)
极速 Angular 开发:效能调校技巧 (ngChina 2019)极速 Angular 开发:效能调校技巧 (ngChina 2019)
极速 Angular 开发:效能调校技巧 (ngChina 2019)
 
Trading bot演算法與軟工在程式交易上的實踐
Trading bot演算法與軟工在程式交易上的實踐Trading bot演算法與軟工在程式交易上的實踐
Trading bot演算法與軟工在程式交易上的實踐
 
Agile tour 2014 - Coding Dojo with C# and TDD
Agile tour 2014 - Coding Dojo with C# and TDDAgile tour 2014 - Coding Dojo with C# and TDD
Agile tour 2014 - Coding Dojo with C# and TDD
 
Agile tour Taipei 2014 - coding dojo with CSharp and TDD
Agile tour Taipei 2014 - coding dojo with CSharp and TDDAgile tour Taipei 2014 - coding dojo with CSharp and TDD
Agile tour Taipei 2014 - coding dojo with CSharp and TDD
 
Bot Framework 和它的快樂夥伴Composer
Bot Framework 和它的快樂夥伴ComposerBot Framework 和它的快樂夥伴Composer
Bot Framework 和它的快樂夥伴Composer
 
理財機器人技術簡介與實作經驗分享
理財機器人技術簡介與實作經驗分享理財機器人技術簡介與實作經驗分享
理財機器人技術簡介與實作經驗分享
 
來玩 Bot Framework Composer 2.0版吧!
來玩 Bot Framework Composer 2.0版吧!來玩 Bot Framework Composer 2.0版吧!
來玩 Bot Framework Composer 2.0版吧!
 
Mochimedia's Success Story - Case Study I (Python-based Company)
Mochimedia's Success Story - Case Study I (Python-based Company)Mochimedia's Success Story - Case Study I (Python-based Company)
Mochimedia's Success Story - Case Study I (Python-based Company)
 
Langchain and Azure ML and Open AI
Langchain and Azure ML and Open AILangchain and Azure ML and Open AI
Langchain and Azure ML and Open AI
 
初探程式語言設計以C#為例
初探程式語言設計以C#為例初探程式語言設計以C#為例
初探程式語言設計以C#為例
 
聊天機器人概論 Introduce to chat bot sevices
聊天機器人概論 Introduce to chat bot sevices聊天機器人概論 Introduce to chat bot sevices
聊天機器人概論 Introduce to chat bot sevices
 
業界都在用的自然語言理解工具,教你快速建構Line對話機器人
業界都在用的自然語言理解工具,教你快速建構Line對話機器人業界都在用的自然語言理解工具,教你快速建構Line對話機器人
業界都在用的自然語言理解工具,教你快速建構Line對話機器人
 

More from Ko Ko

Triton As NLP Model Inference Back-end
 Triton As NLP Model Inference Back-end Triton As NLP Model Inference Back-end
Triton As NLP Model Inference Back-endKo Ko
 
Run Bokeh in back-end, draw real-time charts to front-end, and make data sc...
Run Bokeh in back-end,  draw real-time charts to front-end,  and make data sc...Run Bokeh in back-end,  draw real-time charts to front-end,  and make data sc...
Run Bokeh in back-end, draw real-time charts to front-end, and make data sc...Ko Ko
 
入門 Teams Bot
入門 Teams Bot入門 Teams Bot
入門 Teams BotKo Ko
 
Introduction to MLOps in Azure Machine Learning with Live Demo
Introduction to MLOps in Azure Machine Learning with Live DemoIntroduction to MLOps in Azure Machine Learning with Live Demo
Introduction to MLOps in Azure Machine Learning with Live DemoKo Ko
 
Azure Machine Learning 重頭學
Azure Machine Learning 重頭學Azure Machine Learning 重頭學
Azure Machine Learning 重頭學Ko Ko
 
SignalR整合LINE,在LIFF裡建立一對一聊天管道
SignalR整合LINE,在LIFF裡建立一對一聊天管道SignalR整合LINE,在LIFF裡建立一對一聊天管道
SignalR整合LINE,在LIFF裡建立一對一聊天管道Ko Ko
 
聊天機器人的行銷與開發技巧應用在婚禮上
聊天機器人的行銷與開發技巧應用在婚禮上聊天機器人的行銷與開發技巧應用在婚禮上
聊天機器人的行銷與開發技巧應用在婚禮上Ko Ko
 
簡介Azure在Chatbot開發上的應用
簡介Azure在Chatbot開發上的應用簡介Azure在Chatbot開發上的應用
簡介Azure在Chatbot開發上的應用Ko Ko
 
用 Azure 快速部署與開發 LINE bot
用 Azure 快速部署與開發 LINE bot用 Azure 快速部署與開發 LINE bot
用 Azure 快速部署與開發 LINE botKo Ko
 
簡介Wordpress部署在AWS上的幾種架構
簡介Wordpress部署在AWS上的幾種架構簡介Wordpress部署在AWS上的幾種架構
簡介Wordpress部署在AWS上的幾種架構Ko Ko
 
自然語言理解的 Line 機器人實戰
自然語言理解的 Line 機器人實戰自然語言理解的 Line 機器人實戰
自然語言理解的 Line 機器人實戰Ko Ko
 
三十分鐘內,不用寫程式,教你打造具自然語言能力的聊天機器人
三十分鐘內,不用寫程式,教你打造具自然語言能力的聊天機器人三十分鐘內,不用寫程式,教你打造具自然語言能力的聊天機器人
三十分鐘內,不用寫程式,教你打造具自然語言能力的聊天機器人Ko Ko
 
從負面案例來討論接案工程師該有什麼軟技能
從負面案例來討論接案工程師該有什麼軟技能從負面案例來討論接案工程師該有什麼軟技能
從負面案例來討論接案工程師該有什麼軟技能Ko Ko
 
YOLO V1 論文導讀
YOLO V1 論文導讀YOLO V1 論文導讀
YOLO V1 論文導讀Ko Ko
 

More from Ko Ko (14)

Triton As NLP Model Inference Back-end
 Triton As NLP Model Inference Back-end Triton As NLP Model Inference Back-end
Triton As NLP Model Inference Back-end
 
Run Bokeh in back-end, draw real-time charts to front-end, and make data sc...
Run Bokeh in back-end,  draw real-time charts to front-end,  and make data sc...Run Bokeh in back-end,  draw real-time charts to front-end,  and make data sc...
Run Bokeh in back-end, draw real-time charts to front-end, and make data sc...
 
入門 Teams Bot
入門 Teams Bot入門 Teams Bot
入門 Teams Bot
 
Introduction to MLOps in Azure Machine Learning with Live Demo
Introduction to MLOps in Azure Machine Learning with Live DemoIntroduction to MLOps in Azure Machine Learning with Live Demo
Introduction to MLOps in Azure Machine Learning with Live Demo
 
Azure Machine Learning 重頭學
Azure Machine Learning 重頭學Azure Machine Learning 重頭學
Azure Machine Learning 重頭學
 
SignalR整合LINE,在LIFF裡建立一對一聊天管道
SignalR整合LINE,在LIFF裡建立一對一聊天管道SignalR整合LINE,在LIFF裡建立一對一聊天管道
SignalR整合LINE,在LIFF裡建立一對一聊天管道
 
聊天機器人的行銷與開發技巧應用在婚禮上
聊天機器人的行銷與開發技巧應用在婚禮上聊天機器人的行銷與開發技巧應用在婚禮上
聊天機器人的行銷與開發技巧應用在婚禮上
 
簡介Azure在Chatbot開發上的應用
簡介Azure在Chatbot開發上的應用簡介Azure在Chatbot開發上的應用
簡介Azure在Chatbot開發上的應用
 
用 Azure 快速部署與開發 LINE bot
用 Azure 快速部署與開發 LINE bot用 Azure 快速部署與開發 LINE bot
用 Azure 快速部署與開發 LINE bot
 
簡介Wordpress部署在AWS上的幾種架構
簡介Wordpress部署在AWS上的幾種架構簡介Wordpress部署在AWS上的幾種架構
簡介Wordpress部署在AWS上的幾種架構
 
自然語言理解的 Line 機器人實戰
自然語言理解的 Line 機器人實戰自然語言理解的 Line 機器人實戰
自然語言理解的 Line 機器人實戰
 
三十分鐘內,不用寫程式,教你打造具自然語言能力的聊天機器人
三十分鐘內,不用寫程式,教你打造具自然語言能力的聊天機器人三十分鐘內,不用寫程式,教你打造具自然語言能力的聊天機器人
三十分鐘內,不用寫程式,教你打造具自然語言能力的聊天機器人
 
從負面案例來討論接案工程師該有什麼軟技能
從負面案例來討論接案工程師該有什麼軟技能從負面案例來討論接案工程師該有什麼軟技能
從負面案例來討論接案工程師該有什麼軟技能
 
YOLO V1 論文導讀
YOLO V1 論文導讀YOLO V1 論文導讀
YOLO V1 論文導讀
 

Building Chatbot With Huggging Face