Source Code: nlp-slack-bot

Showd.me is a peer-to-peer learning platform that enables employees to learn valuable skills from other employees in the workplace. I was hired as a ChatBot Developer to develop a bot that interfaced with the Showd.me API to return relevant information to Showd.me users over Slack.

Technologies Used

The Task

Showd.me lets users search for skills, events, users, or particular learning paths that other users may have created.The goal was to create a bot that would allow users to ask questions in a natural language format and the bot would be able to retrieve relevant information from the Showd.me database. In order to do this, the code I would write had to be able to discern and parse actions and entities from text and convert the question into a potential function callthat could be sent over the REST API to retrieve the results the user desired.

I used Andrew Templeton's NLP BotKit Tutorial as the inspiration for this application. In the beginning I had to design the potential functionality of the bot by thinking about the different permutations of how a user could ask certain questions. The training data of relevant questions I came up with can be found here.

I used the Logistic Regression classifier at the level of the nodeJS API with the Natural Library as Andrew Templeton demonstrated to hard code cases where questions related to sessions, learning paths, or personal events could be easily distinguished. I found that parsing the code beyond this to extract further data was not easily conducted with this library, however, because it did not port over all the functionality that Python's NLTK library contained.
middleware to parse the message that a user sends to my bot, and using some functional compostion a la Ramda.js I am able to make a method call to my Python Code
over XMLRPC. The original bottie code would call different funcitons within the middleware file itself, but insetad I have several function defintions
which use the 'skill' that is returned from the Logistic regression classifier in Natural and called as a function in my python NLTK file.

                My [nltk-python github (https://github.com/hariDasu/nltk-python) is created as a submodule within my slackbot github source code.

Deployment

This project was deployed on Google Cloud and was Dockerized. In order to manage container orchestration, I had to learn kubernetes. Kubernetes allowed me to view the logs directly fro the browser, as well as have the ability to scale up either container as I needed. I found docker-cloud and docker-compose to be easier to use, but Kubernetes is supposed to be a better solution for large scale container management and orchestration, so I am glad I was able to spend time to learn and use Kubernetes in this project.

Final Thoughts

If I was able to rewrite this project today, I woudl use some of the newer tools I have come across that weren't available to me at the time when I created this projet.[API.ai] (https://api.ai/) is a great service that
detects parts of speech such as actions, entities, and intents and allows developers to focus more on designing the conversational experiences at a higher level. This layer of abstraction could have enabled me to develop my application quicker, and potentially deliver a more uniform experience to users. [another project I worked on] (https://github.com/hariDasu/lbcbot)>, I used [claudiaJS bot builder] (https://claudiajs.com/claudia-bot-builder.html)>
and found it work great at allowing me to write bot code, and having it deploy the bot to AWS Lambda, and interface easily with many different messaging platforms, rather than just slack. In scenarios where the bot doesn't require usage of platform specific components (such as Slack's interactive message API), claudiaJS can allow me as a developer to create a bot application that is easily able interfaced with many different messaging platforms.