Data and AI

Esports Toxicity Sentiment Analyzer

A TF-IDF and logistic regression classifier scores every message in a simulated 33-minute game chat and plots the rolling toxic-message rate against match events. It reached 0.951 accuracy on held-out data, and the chart shows toxicity rising to 50-70% right after every negative event.

Stack
Python, scikit-learn, pandas, matplotlib
Code
github.com/ADM1SH/toxicity-sentiment-analyzer

Overview

Line chart of the toxic message rate over a synthetic 33 minute match. The rate spikes to about 65 percent after team wipes and lost fights, and drops after kills and clutch plays.
Line chart of the toxic message rate over a synthetic 33 minute match. The rate spikes to about 65 percent after team wipes and lost fights, and drops after kills and clutch plays.

Install

  1. Go to the project folder.
cd "06-toxicity-sentiment-analyzer"
  1. Generate the chat log and match events.
../.venv10projects/bin/python generate_data.py    # writes data/chat_log.csv, data/match_events.csv
  1. Train and evaluate the classifier.
../.venv10projects/bin/python train_classifier.py # trains + evaluates the classifier, saves model.joblib
  1. Score the full log and save the chart.
../.venv10projects/bin/python analyze.py           # scores the full log, saves toxicity_timeline.png

The commands use the shared .venv10projects venv one level up. It already has pandas, scikit-learn and matplotlib.

Docs

The full documentation covers how it works, configuration and results.