This repo contains code for training and executing an AI-based soccer/football commentary engine using OpenAI GPT-2 language model running on top of Google's opensource Football Environment.
This code has been tested on an Ubuntu 18.04 platform with access to an Nvidia GPU.
- Install Google Football Environment (GPU version) from this repository.
- Install text-to-speech library pyttsx3 using
pip install pyttsx3
.
- Use the notebook
src/train_commentary_gpt2.ipynb
on Google Colab to train the model. - Once trained, download the
checkpoint/run1/*
files under this directorysrc/models/345M/
.
- Run
python src/generate_commentary.py
to start the game environment and the commentary engine.