My Wild Card Challenge: Bringing Fans Closer to the Game with AI

What Inspired Me:

As a baseball fan, I've always been fascinated by the data behind the game. But let's be honest, sometimes those stats can be overwhelming, especially for casual fans or newcomers. I wanted to bridge that gap and make the rich information available more accessible and engaging. I was also really excited by the potential of AI to personalize and enhance the fan experience. Seeing how AI can transform other industries made me wonder: how could it revolutionize how we interact with baseball? That's where the idea for this project was born.

What I Learned:

This project was a fantastic learning experience, both technically and creatively. Here are some key takeaways:

  • The Power of Gemini: I discovered just how powerful and versatile Google Cloud's Gemini is. Selecting the right Gemini model was absolutely crucial. It was the key to enabling Gemini to truly become a "baseball expert," capable of understanding the nuances of the game and explaining them clearly. I learned how to fine-tune prompts to get the best results, even giving Gemini clues to watch for specific plays, like inside-the-park home runs (which it actually caught during testing!).
  • Data is King (but Context is Queen): Having access to raw MLB data is great, but it's the context that makes it valuable. Learning how to parse and structure that data for Gemini was essential. It reinforced the importance of data preparation in any AI project.
  • Caching for Performance: AI processing can be computationally intensive. I learned how critical caching AI responses in Firestore was for ensuring a smooth and responsive user experience. This was especially important for the home run video analysis, where real-time processing is essential.
  • User Experience Matters: Building a technically sound app is only half the battle. I learned the importance of keeping the user interface clean, intuitive, and focused on the value proposition. The goal was to make the app accessible to everyone, regardless of their technical expertise.

How I Built It:

My app is built using a combination of technologies:

  1. Data Acquisition: I leveraged the official MLB APIs and home run video CSV data to access a wealth of baseball statistics, player information, and game data.
  2. AI Processing: Google Cloud's Gemini is at the heart of the app. It's used to analyze the data, provide insightful explanations, and power the home run video analysis.
  3. Data Storage: Firestore is used to cache the AI responses, ensuring quick access and a smooth user experience.
  4. App Development: Backend: Python with Flask framework, Firebase, Pandas, Requests, Fuzzywuzzy Frontend: HTML, CSS, JavaScript.

Challenges I Faced:

Building this project wasn't without its challenges:

  • Data Wrangling: Working with large datasets from different sources always presents challenges. Cleaning, transforming, and standardizing the MLB data was a significant undertaking.
  • Gemini Prompt Engineering: Getting the prompts right for Gemini was crucial. It took experimentation and refinement to get Gemini to provide the kind of insightful and user-friendly explanations I was looking for.
  • Performance Optimization: Ensuring a responsive user experience, especially with the video analysis, was a major challenge. Implementing caching and optimizing the AI processing were essential for overcoming this.
  • Balancing Simplicity and Depth: I wanted to make the app accessible to everyone, but I also wanted to provide enough depth for serious baseball fans. Finding the right balance was a constant consideration.

This project was a rewarding experience. It allowed me to combine my passion for baseball with my interest in AI and create something that I believe can genuinely enhance the fan experience. I'm excited to continue developing this app and explore even more ways to use Google Cloud's AI tools to bring fans closer to the game.

Built With

  • backend:-python-with-flask-framework
  • cloud
  • css
  • firebase
  • fuzzywuzzy-frontend:-html
  • google
  • javascript-ai/ml:-gemini-language-model-data-sources:-mlb-provided-datasets
  • mlb-stats-api
  • pandas
  • requests
Share this project:

Updates