Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

如何用連登 data 訓練廣東話 chatbot (How to use data from a popular forum to train a Cantonese chatbot)

748 views

Published on

【直接玩!】Telegram: https://t.me/lihkg_9up_bot
(一開始要講 /start_9up)

Go to https://t.me/lihkg_9up_bot to start chatting with our Cantonese bot (begin by typing /start_9up into the chat!)

有AI既idea 想develop或者想知道更多關於我地既野
上https://oursky.com
Twitter: twitter.com/oursky
Facebook: facebook.com/oursky.hk

Published in: Software
  • Be the first to comment

如何用連登 data 訓練廣東話 chatbot (How to use data from a popular forum to train a Cantonese chatbot)

  1. 1. 如何⽤用連登 data 訓練廣東話 ChatBot
  2. 2. https://t.me/lihkg_9up_bot ⼀一⿑齊傾下偈 我哋整咗隻 9up chatbot
  3. 3. 9up bot 點樣學識傾偈?
  4. 4. ⻝⾷食咗飯未?? (?????) 我哋想做嘅係... 輸 ⼊入 輸 出 輸⼊入廣東話句句⼦子出⼀一句句廣東話句句⼦子
  5. 5. 但係點樣下⼿手?
  6. 6. Machine Learning ⽤用⼤大量量 廣東話 data 做地獄式訓練 seq2seq (sequence to sequence)
  7. 7. ⻝⾷食咗飯未?? ⼀一⿑齊⻝⾷食🤘 於是我哋⽤用咗 Tensor Flow implement ⼀一個 seq2seq framework 輸 出輸 ⼊入 seq2seq (sequence to sequence)
  8. 8. ⻝⾷食咗飯未?? ⻝⾷食 咗 飯 未?? ⼀一 ⿑齊 ⻝⾷食 🤘 ⼀一⿑齊⻝⾷食🤘 乜嘢係 seq2seq?
  9. 9. 仲有咩例例⼦子⽤用到 seq2seq? Google Translate Google Inbox Auto Reply Google Allo
  10. 10. 難題: 究竟有咩廣東話 data ? ( 仲要最好係對話 )
  11. 11. Data 1: 周星馳電影 19 套電影,約10萬條對話
  12. 12. 周星馳電影 對話 (例例⼦子) 唐僧 (Input):做咩呀? 悟空 (Output):放⼿啊! 悟空 (Input):放⼿啊! 唐僧 (Output):你愛呀?你愛出聲⾄得架。你愛我會畀你。你唔愛我當然唔 畀你啦!無理由你話愛,我唔畀你,你唔愛我畀你架。⼤家講道理吖嘛! 嗱,我數三下,你話愛唔愛喇噃。⼀……
  13. 13. Data 1: 周星馳電影 19 套電影,約10萬條對話 100,000 條對話其實太少 唔⾜足以訓練到有意義嘅對話
  14. 14. Again: 究竟有咩廣東話 data ? ( 仲要最好係對話 )
  15. 15. Data 2: 連登 爬取連登吹⽔水台 64,751個 post , 只篩選有10個 reply 以上嘅post 剩下 18,290個
  16. 16. Data 2: 連登 18,290個 post 擷取超過1,700,000條對答 ⽤用program 分析所有post,選取「對答」data, 規則如下: 1. 如果有Quote Reply:⽤用reply做「輸⼊入」 2. 如果冇Quote Reply:⽤用原post title+內⽂文做「輸⼊入」 3. 如果原post太⻑⾧長,只會⽤用Title 做「輸⼊入」
  17. 17. 例例⼦子 以下係選取 training data 例例 ⾹香港係咪冇⼈人聽metal? 問⼗十個⾹香港⼈人都話metal係噪⾳音 metal同好 metal同好 咩類類型 輸⼊入 輸⼊入 輸出 輸出 有Quote Reply 冇Quote Reply, ⽤用原post title+內⽂文做「輸⼊入」
  18. 18. 結果
  19. 19. 點樣⽤用 9up bot API ? For developers
  20. 20. Model Parameters Summary Custom configurations • seq2seq model with attention • 5 layers encoder and decoder • vocabulary size: 63000 • state vector size: 256 • learning rate: 0.5 • learning decay factor: 0.99 • batch size: 64 • bucket sizes (encoder length, decoder length) • 10, 10 • 20, 30 • 40, 30 • 60, 30

×