zake7749 / Luis-LineBot

a chatbot published on line, using LUIS for intent classification.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Luis-LineBot

This is a demo of how to use and connect Mircosoft Language Understanding Intelligent Service(LUIS) to chatbot server.

LuisWrapper

LuisWrapper which is a wrapper of Cognitive-LUIS-Python provides an interface of intent classification. We can initialize it by a string of LUIS_APPID and LUISAPPKEY that can be found in your app main page on LUIS platforms.

from luis_wrapper import LuisWrapper
luis_wrapper = LuisWrapper(YOUR_LUIS_APPID, YOUR_LUIS_APPKEY)

We can sent a requset to LUIS by calling luis_wrapper.predict(query), which return the top intent and some entities found in the query.

query = 'Hello! How are you?'
top_intent, entities = luis_wrapper.predict(query)

For more details on connecting a chatbot server to Line, please refer Line-Chatbot (on django) or line-bot-sdk-python (on flask)

About

a chatbot published on line, using LUIS for intent classification.


Languages

Language:Python 100.0%