This repository contains sample code for my session "Build a FAQ bot with deeplearning4J" Feel free to clone this repository and modify the code.
Before you can use the code, please follow these steps to set everything up.
- Clone the repository
https://github.com/Microsoft/botbuilder-java
to disk - Open a terminal and navigate to the repository
- Run the command
mvn install
to install the botbuilder SDK for Java - Clone the repository
https://github.com/wmeints/qna-bot
to disk - Using your terminal, navigate to the repository
qna-bot
- Run
mvn clean compile
to check if the code compiles
This project relies on a FAQ model that you need to train first. Follow these steps to train the model:
- Edit the questions and answers file in
./data
you can refer to answers by the unique index for the answer. - Package the training application by running
mvn package
- Execute the training application with
java -jar training/target/training-1.0-SNAPSHOT.jar
Please be aware The process of training a model may take a lot of time, depending on your machine. Also note that you need CUDA 9 and a CUDA capable graphics card.
This code runs on top of tomcat 9. You need to install Tomcat on your computer first. You can get a copy over at https://tomcat.apache.org/download-90.cgi.
Follow these steps to deploy the application:
- Run
mvn package
in theservice
project folder to package the project as a WAR file. - Copy the war file from
target/
to thewebapps
folder in the tomcat install folder. - Start tomcat with
bin/catalina.sh run
orbin/catalina.bat start
if you work on Windows.
The app should now be available under http://localhost:8080/qnabot
Configure the Microsoft Bot Emulator to point to http://localhost:8080/qnabot/api/messages
for the bot endpoint.
You can leave the appId and password setting empty.