Inspiration
As students and young adults become increasingly exposed to current issues and controversial matters, they become more prone to toxic content that can cause emotional damage while not gaining any meaningful information about those issues. As students ourselves who frequently use online discussion forums and participate in conversations, we found that a safe chat that filters toxicity would be optimal for an informative and engaging discussion.
What it does
The program allows multiple users to join a chat about a certain topic that they either choose or create. Inside the chat, a user can message their thoughts anonymously to the public regarding the topic the chat is about. However, before the message becomes delivered to all other users, the message goes through a program that determines if the message is toxic or not. If the program finds that the message is safe for others to see, it is outputted on the screen. Otherwise, the message is not shown on the screen.
How we built it
Technologies used: Python, Flask, JavaScript/jQuery, HTML, CSS, Cohere, Firebase
We used Flask and Socket.IO to create a chat app. Flask was used along with Python to create the general routes for each HTML file for the web application. On bottom of the screen of the web application, there would be a form for the user to use. Here, a user would type their thoughts. Through Socket.IO and JavaScript, we made a program where the user's input would be sent to our program's end and subsequently displayed on the screen by appending the text to sections in the HTML file. However, before a message was displayed, it went through a check system we implemented with Cohere. This system determined whether a message was toxic or not. If it was determined to be toxic, the message would not be displayed on the screen. Otherwise, the message was passed and appeared in the chat box.
Challenges we ran into
- Initially, having a chat connect to multiple users on different computers was challenging. With Socket.IO, we eventually enabled the same chat on a single topic to be accessed by all users that open the web application.
- Another problem we faced involved the disappearance of a user's messages when a user refreshed their page. This was unwanted not only because of inconvenience for the user, but also because our project aimed to keep a stable record of all conversations on our web application so that discussions can be referred to and read about in the future. We eventually avoided this problem through the use of Firebase.
Accomplishments that we're proud of
- Front-end: We are proud of the overall appearance of the web application. Through HTML, CSS, and JavaScript, we were able to create a customized and interactive design that allows a user to easily navigate among different chats and view other conversations with a simple and organized design.
- Cohere: We are also proud of successfully training our Cohere API to accurately detect toxic language in a user's message. By training the automation process with multiple exams, we were able to have the program successfully identify double negatives in the English language so that more complex conversations can be safely filtered.
What we learned
We learned how to use a wide variety of programming languages as well as other technologies. For example, we learned how to employ Socket.IO to create a Flask chat app. This involved a long and hard process of incorporating jQuery to our HTML file to make sure a connection was made between the client and our program, and thus allowing a user's messages to be displayed onto the screen. Therefore, all members of the team became much more familiar with the intricacies of jQuery and learned how to integrate Socket.IO with Flask to create an appropriate app.
What's next for Co//oquia
Moving forward, Co//oquia could be improved by enabling edit or unsend buttons for users who wish to modify or delete their messages. Furthermore, the creation of a login page may be useful to guard the website against bots and spamming so that discussions can continue to be meaningful and informative.
Log in or sign up for Devpost to join the conversation.