GithubHelp home page GithubHelp logo

linebot-museumbot's Introduction

MuseumBot博物館導覽Line聊天機器人

本專案設計了一個博物館導覽Line聊天機器人。這個專案主要分成三個部分:

  • 第一部分為Dialogflow部分

    • 這部分使用了Google Dialogflow的服務,使用前先至Dialogflow的網站註冊並創建一個新的項目。
    • Dialogflow中的MuseumBot_Dialogflow.zip是將我利用蘭陽博物館網站上的QA集訓練的intent以及entities打包下來,如果要使用的話需要到剛剛創建的項目的設定中找到Export and Import,並選擇IMPORT FROM ZIP將剛剛的zip導入(如圖1)。
    • MuseumBot檔案中的museum.py程式裡面需要輸入dialogflow的API金鑰(DIALOG_API_KEY),同樣是在創建項目的設定中的General中找到(如圖2)。
    • 有什麼疑問可以參考Dialogflow的說明文件

    image

    圖1

    image

    圖2

  • 第二部分為建置LineBot

    • 這部分使用了Line聊天機器人的服務,使用前先至Line Developer的網站註冊並創建一個新的項目。
    • MuseumBot檔案中的museum.py程式裡面需要輸入CHANNEL_ACCESS_TOKEN以及CHANNEL_SECRET,可以在剛剛創建的項目中找到(如圖3圖4)。

    image

    圖3

    image

    圖4

    • 將程式碼上傳到Heroku中(以下為macOS為例子示範如何將程式上傳)

      1.到官網上下載Heroku
      https://devcenter.heroku.com/articles/getting-started-with-python#set-up

      2.註冊並登錄Heroku的帳號

      3.打開Terminal終端機並輸入以下程式來登錄Heroku
      heroku login

      4.在heroku創建一個app並將Buildpacks設定為python(我們這邊要上傳的是py檔案)
      heroku create food-assistant --buildpack heroku/python
      其中create後面放app專案的名字,例如food-assistant就是一個專案的名字

      5.在Heroku中找到對應的app的專案
      heroku git:remote -a food-assistant
      其中-a之後的就是app專案的名稱,其中food-assistant就是專案的名稱

      6.將路徑設定到我們的檔案
      cd /Users/apple/Desktop/LineBot-MuseumBot

      7.創建requirements.txt紀錄的我們python中用到哪些套件用於告訴Heroku需要用到哪些套件
      pip freeze > requirements.txt

      8.創建Profile告訴heroku
      pip install gunicorn
      echo "web: gunicorn linebot:app" > Procfile

      9.將檔案上傳至git
      git add .
      git commit -m "這裡加上註解"
      git push origin master

    • 找到Heroku中settings的網址並將它放到Line Developer中的Webhook URL中(如圖5圖6)。

    • 有什麼疑問可以參考Line Developer的說明文件

    image

    圖5

    image

    圖6

  • 第三部分為Firebase服務

    • 這部分使用了Google Firebase的服務,使用前先至Firebase的網站註冊並創建一個新的項目。
    • 創建完新的項目之後到設定/使用者權限/服務帳戶中產生新的私密金鑰(如圖7),並在MuseumBot檔案中的museum.py程式裡面輸入FIREBASE_API_KEY
    • 利用Firebase製作一個資料讀取與儲存的功能。
    • 有什麼疑問可以參考Firebase的說明文件

    image

    圖7

  • 第四部分為Django並放在heroku免費雲端服務上面

linebot-museumbot's People

Contributors

pochuanhuang avatar arrowhuang avatar

Forkers

guancioul

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.