Inspiration
Recently, my management class had a passionate discussion about microaggressions. Hearing about my classmates' experiences really opened my eyes to the impact that comments we might pass off as "nothing much" or "just a joke" can have on a person's mental health and self-esteem. I was inspired to do more research and leverage technology to take a stand against microaggressions.
What it does
Radar is a Discord bot trained to identify microaggressions in messages. Based on the category of microaggression, Radar then provides a specific explanation of why a user's comments were harmful. The bot also comes with an interactive learning module that educates users about different types of microaggressions.
How I built it
Radar was built entirely in Python. I used NLTK to parse my training dataset, then I trained my logistic regression model using scikit-learn. My logistic regression classifies a message by determining if it is clean or if it falls into one of the identified microaggression categories. If so, the bot responds to the microaggression with a warning and explanation. I crafted the user-bot interactions with discord.py. In addition to the bot's automatic response system, users can manually interact with the bot to take a learning module and increase their own awareness of microaggressions. The learning module advances as the user clicks emoji depending on the path they want to take.
Challenges I ran into
Most of my past experience pertains to web development, so diving headfirst into Discord bots was
a challenging experience (but no less thrilling). There were so many event listeners that I didn't know where to start, from on_reaction_add
to on_raw_reaction_add
to wait_for(reaction_add)
. It definitely took me some time and testing, testing, testing to figure out what I needed! Then, I couldn't find a training dataset that fit my needs, so I had to compile my own training dataset based on examples that I found through research.
Accomplishments that I'm proud of
I'm proud that I expanded my horizons. At first, I was thinking about doing data visualization, which I'm already comfortable with. But I decided to take a different direction, and I'm happy that I got the bot up and running!
What I learned
I learned how to respond to user events using the Discord API. In the process, I learned a lot about how Discord protects their users' data, including OAuth2, tokens, and privileged intents.
What's next for Discord Bot: Radar
I want to compile even more data, because microaggressions come in so many forms that my current dataset is nowhere near complete. With a more comprehensive dataset, I can more rigorously train my algorithm to differentiate between user messages and increase Radar's effectiveness. I also want to add more educational content and the ability to report a microaggression to server moderators if the bot doesn't catch it.
Built With
- discord.py
- python
- scikit-learn
Log in or sign up for Devpost to join the conversation.