This is a task-oriented chatbot demo for searching stock information. The chatbot uses Rasa-NLU to extract intents and entities from the input. After that, the chatbot uses the extracted information to automatically create an inquiry and utilize the inquiry to search about the information. Finally, the chatbot generates an answer using the pre-defined templates and returns it to users. The chatbot supports up to three rounds of dialogue.
- Python(==3.6)
- Twisted
- Rasa NLU
- chatito
- rasa-nlu-trainer
- wxpy
git clone https://github.com/mathfather/StockBot
Open the root folder. Generate the data using the following command:
npx chatito data_generator/intent.chatito --format=rasa --outputPath=data --trainingFileName=trainingset.json --testingFileName=testingset.json intent.chatito
The training and testing date will be saved in a seperate folder called data, which is under the root folder.
If you want to check out the data by yourself, try the following:
rasa-nlu-trainer
And the data visualization will be shown in the browser.
Train the model using the following command:
python model.py
After the training process, the trained model will be saved in models/default, with its name looks like this: 'model_20190531-173549'.
To run the bot on wechat, run:
python wechat.py
Scanned the QR code on screen with your wechat app to make your account the host of the bot.
Then, use your own natural language to ask the chatbot your question. Conversation examples are listed belowed.
To test your model's ability in information extraction, use the following:
python accuracy.py
It will output the accuracy in the terminal.