For moderating large communities, it is useful to have some automated helpers to keep track of the message, and this is where the idea of the bot originated. This, along with the thought of having an end to end pipeline (Machine learning model to Discord Bot) really excited us.
What it does
The bot can be added to any server, and for all new messages, it calculates the profanity score through the deployed model. If profanity was detected, it adds the user to an offenders list in the database, and sends back a warning message.
There's also a dashboard that consumes the offenders list and collates all the information in an easily accessible place.
How we built it
We used a bidirectional LSTM for the model, which was then rigged into a server using BentoML. This was finally deployed on Heroku using Docker.
On the bot side, we used the discord.py library for the bot interactions, and a Mongo DB database to store the offenders list.
Challenges we ran into
It was a bit difficult to get all the dependencies sorted out for deployment, and although the initial model was up fairly quickly, to get all the dependencies into the BentoML generated services was a bit challenging.
Collaboration was also difficult, since we were from different timezones and so finding a common time to meet was difficult.
Accomplishments that we're proud of
We have somewhat realized our original vision for the bot: To have an easy automated way to keep track of offenders.
What we learned
The project was a great starting point to explore BentoML. We learned about its power in quickly getting the routine server side code and deployment boilerplate around the model, along with its flexibility in supporting various deployment methods and model libraries (PyTorch, TensorFlow, etc).
What's next for Profanity Filter Bot
- Improve the profanity predictions
- Improve the dashboard functionality and add in further administration capabilities