Inspiration

There has been an increase in both supply and demand for streaming, and streaming platforms such as Twitch and Youtube have become larger and larger. However, some streamers struggle to gauge what the audience is saying, because the only way to decipher what the chat is saying is through eyeballing dozens of messages scrolling up every second. We decided that we could implement features that would help streamers visually understand what the audience is saying, by automating the generation of useful statistics.

What it does

There are two main statistics that the web app generates and presents. One is the number of chats per minute, displayed in gradients of ten seconds over the span of two minutes, and the other is the six most frequently typed words in the chat. The current user interface consists of one refresh button, which restarts the word frequency distribution and resets the frequent word graph.

How we built it

We used TwitchIO library to create a bot that listens to chats coming to specific streamers' streams. The messages are then fed into our NLP processing class, which tokenizes the chat strings, turns them into lowercase, and stores them in a dictionary as a frequency distribution. The NLP processing class was built with NLTK, a NLP library in Python. Statistics for chat per minute are also calculated concurrently in the NLP class, which the bot calls for whenever it needs to create a graph. The webpage was built using Flask. The Flask app calls the Javascript program that invokes the HTML and CSS scripts to display the webpage, and the Flask script also manages the creation and communication with the Twitch Bot. For example, the app notifies the Bot whenever a button is pressed, to execute procedures such as refresh.

Challenges we ran into

We spent the majority of debugging time on two operations: concurrency and user interface. The Flask app and the Bot had to run at the same time, and given our limited experience on async functions in Python, we chose to implement concurrency using multithreaded processes in Python. It was our first time using this tool with Flask, and encountered multiple errors regarding functions running multiple times and data races. User interface was also a challenge, as the buttons sometimes would not communicate with the Bot, and this was in part a concurrency challenge too. An embarrassing mistake we made was editing the wrong file with the same name as the file we had to edit, which set us back about 2 hours.

Accomplishments that we're proud of

The most crucial part of the project was getting the Twitch bot to read chat data from Twitch, which we succeeded in a surprisingly short amount of time. Building the NLP class with NLTK was also very smooth, and undergrad algorithms courses definitely helped in this area. None of us were particularly familiar with Flask, but one of our teammates stepped up and learned Flask in a few hours, and we were able to have a working front end. Integrating all the modules with the limited knowledge we had was hard, but the end result of a webpage that created live visuals with data scraped off of Twitch chat was awesome. We are also very proud of our very trendy logo!

What we learned

We learned how to program concurrently with web development, how to make a decent project work in a very limited amount of time, and how to use every team member's potential by dividing tasks in a way that maximizes our expertise in our best fields.

What's next for Chit Chart

We could make our webpage work with different streaming platforms such as Youtube or TikTok. We plan to improve our user experience with more buttons that give control to the user over more of our parameters. We have not deployed our website on a real server, and we wish to deploy our project so that people can use it anytime from anywhere. Our tool could also gather and analyze big data about the slangs and sentiment of streamers’ chats. This would enable better identification and categorization of streamers, which would be useful in applications such as recommendation algorithms.

Share this project:

Updates