{"slug": "building-pitchpassion-ai-transforming-football-passion-into-data-with-google-ai", "title": "Building \"PitchPassion AI\": Transforming Football Passion into Data with Google AI", "summary": "A developer built PitchPassion AI, a web application that uses the Google Gemini API to transform football match narratives into player performance visualizations. The app extracts structured data from unstructured text, overcoming challenges like API errors and inconsistent formatting through prompt engineering and backend sanitization.", "body_md": "*This is a submission for Weekend Challenge: Passion Edition*\n\nI built **PitchPassion AI**, a web application that transforms text-based football match narratives into informative player performance visualizations using AI. The goal is to help fans quickly understand *statistics* without having to read lengthy reports.\n\nI will include a video demo link below.\n\n**Video Demo:** [Video File](https://drive.google.com/drive/folders/139eY8ywVfvYyK3Sc6bVflpvPVtYBfjeB?usp=drive_link)\n\nThis is where I utilize the Google Gemini API as a data extraction engine:\n\n**Natural Language Processing (NLP):** Gemini reads the match narrative to comprehend the context—identifying the players involved, the actions performed (goals, assists, tackles), and the quality of those actions.\n\n**Structured Transformation:** I provide specific instructions (prompts) to the model so that it not only understands the text but also transforms it into a JSON format.\n\n**Data Cleaning:** Since AI sometimes includes conversational text in its output, I implemented middleware in Flask to clean the response and ensure that only pure JSON data enters my application.\n\n`503 Unavailable`\n\nresponses from the Google Gemini API. This was caused by traffic spikes on the server side.**Inconsistent Data Formatting**\n\nAnother major challenge was the AI's tendency to be \"too chatty.\" Instead of providing pure JSON data, the AI would often include introductory text like \"*Here is the data you requested...*\" This caused my frontend application to fail when parsing the data.\n\n**Solution:** I implemented two layers of protection:\n\n**Prompt Engineering:** I reinforced the system instructions with the command: \"*Provide only the JSON, without any additional explanation.*\"\n\n**Backend Sanitization:** I added a cleaning function in Python using `replace()`\n\nand `strip()`\n\nto remove Markdown characters (such as `'''json`\n\n) before passing the data to `json.loads()`\n\n.\n\nI am submitting this project for the **Best use of Google AI** category.\n\nPitchPassion AI relies entirely on the **Google Gemini API** to bridge the gap between unstructured sports narratives and structured data visualization. By leveraging Gemini's natural language processing capabilities, the application is able to extract player names and performance scores from messy, human-written match reports in real-time. Without the sophisticated data extraction power of Google AI, transforming narrative content into the dynamic charts displayed in this app would not have been possible.", "url": "https://wpnews.pro/news/building-pitchpassion-ai-transforming-football-passion-into-data-with-google-ai", "canonical_source": "https://dev.to/fauzan18296/building-pitchpassion-ai-transforming-football-passion-into-data-with-google-ai-4ooc", "published_at": "2026-07-10 18:35:41+00:00", "updated_at": "2026-07-10 19:17:35.129108+00:00", "lang": "en", "topics": ["artificial-intelligence", "natural-language-processing", "ai-tools", "developer-tools"], "entities": ["Google Gemini API", "PitchPassion AI", "Flask"], "alternates": {"html": "https://wpnews.pro/news/building-pitchpassion-ai-transforming-football-passion-into-data-with-google-ai", "markdown": "https://wpnews.pro/news/building-pitchpassion-ai-transforming-football-passion-into-data-with-google-ai.md", "text": "https://wpnews.pro/news/building-pitchpassion-ai-transforming-football-passion-into-data-with-google-ai.txt", "jsonld": "https://wpnews.pro/news/building-pitchpassion-ai-transforming-football-passion-into-data-with-google-ai.jsonld"}}