Real-Time Match Insights from Commentators Narration โ All in Your Browser.
GOALIE is a browser extension (designed for Chromium) that simulates real-time football match updates, complete with AI-powered snippet generation, tactical commentary classification, and interactive match displays. It features a sleek UI and integrates with a Flask-based backend that talks to a Gradio-hosted classifier.
- ๐ฎ Live Match Simulation with realistic minute-by-minute commentary (For Demostartion Purposes)
- ๐ฌ AI-Generated Snippets describing the current game state
- ๐ NLP Classification of football commentary using Hugging Face + Gradio
- ๐ง Event Detection for goals, fouls, corners, substitutions, and more
- โ๏ธ Configurable Match Data (currently with limited commentary, in production using SportsMonk API (Extension Under Development))
- ๐ Dark Themed UI with smooth animations and responsive layout
Layer | Technology |
---|---|
Frontend | HTML, CSS (custom + variables), JavaScript |
UI Libraries | Feather Icons, Google Fonts (Inter) |
Backend | Python, Flask, Flask-CORS |
AI/NLP | Hugging Face Transformers (via Gradio client) |
Hosting | Local Flask server + Gradio space endpoint |
GOALIE classifies football commentary into 3 categories โ CURRENT
, PAST
, and IRRELEVANT
โ using supervised NLP techniques.
- Source: SoccerNet-Echoes (whisper_v3/en)
- Processed version:
football_commentary_balanced.csv
(balanced to 50,000 samples/class) - Final shape: 149,981 samples
- Columns:
game
,text
,label
Used only English commentary. Filtered and balanced across the 3 label classes.
Rank | Model | Vectorizer | Accuracy | F1 Score | CV Score (ยฑstd) | Time (s) |
---|---|---|---|---|---|---|
1 | Logistic Regression | TF-IDF (Char 2-5) | 0.9966 | 0.9966 | 0.9959 ยฑ 0.000 | 135.03 |
2 | Random Forest | TF-IDF (Char 2-5) | 0.9873 | 0.9874 | 0.9889 ยฑ 0.001 | 266.37 |
3 | Logistic Regression | Count (1-2gram) | 0.9790 | 0.9790 | 0.9791 ยฑ 0.001 | 21.72 |
4 | Logistic Regression | TF-IDF (1-3gram) | 0.9789 | 0.9789 | 0.9774 ยฑ 0.001 | 17.25 |
5 | Logistic Regression | TF-IDF (1-2gram) | 0.9773 | 0.9773 | 0.9757 ยฑ 0.001 | 15.50 |
6 | Random Forest | TF-IDF (1-2gram) | 0.9340 | 0.9336 | 0.9351 ยฑ 0.002 | 22.90 |
7 | Random Forest | TF-IDF (1-3gram) | 0.9332 | 0.9329 | 0.9322 ยฑ 0.000 | 25.37 |
8 | Naive Bayes | TF-IDF (Char 2-5) | 0.9331 | 0.9328 | 0.9341 ยฑ 0.001 | 108.53 |
9 | Random Forest | Count (1-2gram) | 0.9315 | 0.9312 | 0.9329 ยฑ 0.001 | 30.64 |
10 | Naive Bayes | TF-IDF (1-3gram) | 0.8689 | 0.8646 | 0.8640 ยฑ 0.002 | 14.73 |
Model : Logistic Regression
Vectorizer: TF-IDF (Character-level, 2โ5)
Accuracy : 0.9966
F1 Score : 0.9966
CV Score : 0.9959 ยฑ 0.000
git clone https://github.com/16kushaal/GOALIE-Live-Sports-Extension.git
cd GOALIE-Live-Sports-Extension
โ ๏ธ Ensure you have Python 3.8+ andpip
installed.
pip install Flask Flask-Cors python-dotenv gradio_client
Create a .env
file in the root directory:
GRADIO_SPACE=<your_gradio_space_url>
HF_TOKEN=<your_huggingface_token>
Then run:
python app.py
Your API will be hosted at http://127.0.0.1:5000/classify_and_log
- Open Chrome โ
chrome://extensions
- Enable Developer Mode
- Click Load unpacked โ select the repo folder
Ensure the following file exists and is correct:
manifest.json
In popup.js
, replace:
const GEMINI_API_KEY = 'ADD_YOUR_GEMINI_API_HERE';
with your actual API key, or handle it through a proxy if sensitive.
FOOTBALL-SCORE-EXTENSION/
โ
โโโ .venv/ # Python virtual environment
โโโ .env # Environment variables (Gradio + HuggingFace tokens)
โโโ README.md # Project documentation
โโโ app.py # Flask backend server (text classification + Gradio client)
โโโ text.txt # Match event commentary samples
โ
โโโ football-live-extension/ # Chrome Extension Source
โ โโโ manifest.json # Chrome Extension manifest (v3)
โ โโโ popup.html # Main popup UI HTML
โ โโโ popup.css # Extension styling (themed, responsive)
โ โโโ popup.js # Frontend logic, AI snippet updates, match selection
โ โโโ images/ # Logos/icons (48x48, etc.)
โ
โโโ model/ # ML-related assets
โ โโโ data/ # Labeled and balanced datasets
โ โ โโโ football_commentary_labelled.csv
โ โ โโโ football_commentary_balanced.csv
โ โโโ results/ # Outputs (model + visualizations)
โ โ โโโ output.png # Example plot/metric image
โ |โโ football_classifier_model.pkl
โ โโโ dataset.ipynb # Preprocessing, balancing, and exploration
โ โโโ model.ipynb # Training and evaluation of the classifier
-
User selects a match from the popup.
-
Commentary events simulate live match progression every few seconds.
-
Commentary is sent via
fetch()
to Flask (/classify_and_log
) where:- It's processed by a Gradio-hosted transformer model
- The classification (Current, Past, Irrelevant) is logged and printed
-
The popup UI updates the snippet and events visually based on the result.
{
"type": "commentary", "text": "Dembรฉlรฉ hits the post! That was close!"
}
{
"type": "score", "scorer": "Mbappรฉ", "team": "home", "newScore": [1, 0]
}
{
"type": "foul", "text": "Yellow card for Caicedo."
}
- Add real-time data API support (from SportsMonk)
- Improve snippet generation using Gemini API (currently simulated)
- Save commentary logs to a database
- Add user team preferences and theming
- Dockerize backend for production deployment
git clone https://github.com/16kushaal/GOALIE-Live-Sports-Extension
cd GOALIE-Live-Sports-Extension
pip install -r requirements.txt
python -m spacy download en_core_web_sm
Create a .env file in your root directory and add the following:
GRADIO_SPACE=<your_gradio_space_url>
HF_TOKEN=<your_huggingface_token>
python app.py
Made with โฝ and ๐ป by @16kushaal
Apache-2.0 license. See LICENSE
for more information.