{"id":23396379,"url":"https://github.com/mneedham/devoxx-ai-sports-commentary","last_synced_at":"2025-09-12T06:40:07.854Z","repository":{"id":231112641,"uuid":"780933320","full_name":"mneedham/devoxx-ai-sports-commentary","owner":"mneedham","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-17T10:47:36.000Z","size":63,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-16T02:45:14.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mneedham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-02T12:44:21.000Z","updated_at":"2024-12-23T15:11:02.000Z","dependencies_parsed_at":"2024-04-22T11:49:10.695Z","dependency_job_id":null,"html_url":"https://github.com/mneedham/devoxx-ai-sports-commentary","commit_stats":null,"previous_names":["mneedham/devoxx-ai-sports-commentary"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mneedham/devoxx-ai-sports-commentary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mneedham%2Fdevoxx-ai-sports-commentary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mneedham%2Fdevoxx-ai-sports-commentary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mneedham%2Fdevoxx-ai-sports-commentary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mneedham%2Fdevoxx-ai-sports-commentary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mneedham","download_url":"https://codeload.github.com/mneedham/devoxx-ai-sports-commentary/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mneedham%2Fdevoxx-ai-sports-commentary/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273226928,"owners_count":25067629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-22T07:35:19.267Z","updated_at":"2025-09-02T03:41:18.705Z","avatar_url":"https://github.com/mneedham.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Devoxx: Game, Set, Match: Transforming Live Sports with AI-Driven Commentary\n\nThis is the repository for a talk by Mark Needham and Dunith Danushka at Devoxx UK 2024.\n\nhttps://www.devoxx.co.uk/talk/?id=11171\n\n\u003eWe are both big fans of the live text commentary that the BBC provide for sports like football, tennis, rugby, cricket and more. While there are a lot of novel observations in the commentary, there is also a lot that is effectively summarising what just happened.\n\u003eWouldn't it be cool if the commentator could have a Co-Pilot who can make the process more efficient?\n\u003eIn this session, we will introduce an AI Co-Pilot for sports commentary based on Redpanda, ClickHouse, Flink, and a Large Language Model. A stream of events will be fed into RedPanda and we'll capture a window of those events on game-by-game and/or time-period buckets using Flink. These events, alongside historical match data, will also be stored in ClickHouse.\n\u003eWe'll then send the LLM the events that have just happened along with queries on historical data, from which it can come up with suggested text commentary. The commentator can then decide whether they want to use the Co-Pilot's suggestion, edit the suggestion, or just go along with their own version.\n\nThis we need\n\n* A stream of events related to a match\n* A page that shows commentary of the match\n* A page where the live commentary writer can add a new message\n    ** On that page we should show the latest events and have a button to generate an AI message\n    ** A way to bring in stats related to the players/tournament/etc\n\nAn example of what the live page should look like:\n\nhttps://www.bbc.co.uk/sport/live/tennis/66006317/page/4\n\n## Instructions\n\nStart Redpanda\n\n```bash\ndocker compose up\n```\n\nDownload ClickHouse\n\n```bash\ncurl https://clickhouse.com/ | sh\n```\n\nOn another tab, configure ClickHouse Server\n\n```bash\nmkdir clickhouse-server \u0026\u0026 cd clickhouse-server\n./clickhouse server\n```\n\nCopy `matches.csv` over\n\n```bash\ncp ../data/matches.csv user_files\n```\n\nConnect with ClickHouse Client\n\n```bash\n./clickhouse client -mn\n```\n\nSetup ClickHouse tables\n\n```sql\nCREATE TABLE pointsQueue(\n    match_id String,\n    id String,\n    time String,\n    player1 String,\n    player2 String,\n    previous_sets Array(String),\n    server String,\n    set String,\n    game String,\n    set_score String,\n    point_score String,\n    description String,\n    game_winner String,\n    publish_time String,\n    event_type String,\n    event_round String\n)\nENGINE = Kafka(\n  'localhost:9092', \n  'points', \n  'points-consumer-group', \n  'JSONEachRow'\n)\nSETTINGS kafka_flush_interval_ms=500;\n\nCREATE TABLE points (\n    match_id String,\n    id String,\n    time String,\n    player1 String,\n    player2 String,\n    previous_sets Array(String),\n    server String,\n    set String,\n    game String,\n    set_score String,\n    point_score String,\n    description String,\n    game_winner String,\n    publish_time DateTime32,\n    event_type String,\n    event_round String,\n) \nENGINE = MergeTree \nORDER BY match_id;\n\nCREATE MATERIALIZED VIEW points_mv TO points AS \nSELECT * REPLACE(\n    parseDateTime32BestEffort(publish_time) AS publish_time\n)\nFROM pointsQueue;\n\n\nCREATE TABLE matches\nORDER BY match_id AS\nSELECT * REPLACE(\n    toString(match_id) AS match_id\n)\nFROM file('matches.csv') \nSETTINGS schema_inference_make_columns_nullable=0;\n```\n\nInstall Python dependencies\n\n```bash\npoetry install\n```\n\nConfigure OpenAI API key\n\n```bash\nexport OPENAI_API_KEY=\"sk-xxx\"\n```\n\nStart commentator app\n\n```bash\npoetry run streamlit run apps/commentator.py --server.headless true\n```\n\nNavigate to http://localhost:8501","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmneedham%2Fdevoxx-ai-sports-commentary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmneedham%2Fdevoxx-ai-sports-commentary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmneedham%2Fdevoxx-ai-sports-commentary/lists"}