This project uses the rasa framework to provide a chatbot for ordering boba tea, taking 幸福堂 as a reference.
You may access a live version of this chatbot via our server at home.
- System with support for the x86 instruction set
- Git
- Docker
- NodeJS (with npm)
- Clone the repo from github
git clone https://github.com/Skyquek/milktea-CN_chatbot-nlp.git
- Give exectable permissions
cd milktea-CN_chatbot-nlp
chmod 0777 buildAll.sh
- Run the build process
./buildAll.sh
- Once everything has finished building, you may access the chatbot service via your browser at:
http://<your-ip>:52288/
- Clone the repo from github, then go into the folder
git clone https://github.com/Skyquek/milktea-CN_chatbot-nlp.git
cd milktea-CN_chatbot-nlp
- Go into the folder containing the frontend code
cd ./public
- Build the frontend files
npm install
ng build --prod
- Build the docker image
docker build -t xingfutang-chatbot-frontend . --no-cache
- Run the docker image (you may change the port number - 52288 to any number you desire)
docker run --name xingfutang-chatbot-frontend -p 52288:80 -d xingfutang-chatbot-frontend
- Done!
- Build the docker image
docker build -t nlp-chatbot:latest .
- Run the docker image
docker run --name xinfutang -p 5005:5005 -d ai-trademark-frontend
- Done!
- Start bert-as-service. bert-as-service is a sentence encoding service for mapping a variable-length sentence to a fixed-length vector.
bert-serving-start -model_dir chinese_L-12_H-768_A-12/ -num_worker=1
- start action server
rasa run actions
- train a model
rasa train
-
talk to your chatbot
-
API:
rasa run
-
CMD:
rasa shell
-
-
EXPOSE the PORT NUMBER
URL: "http://localhost:5005/webhooks/rest/webhook"
Method: POST
Header: Content-Type: application/json
Body:
{
"sender": "Quek",
"message": “奶茶”
}
Response:
[
{
"recipient_id": "Quek",
"text": "你好"
},
{
"recipient_id": "Quek",
"text": "想要喝点什么?"
}
]