radio analysis view - VforVitorio/F1_Strat_Manager GitHub Wiki

Radio Analysis View

VforVitorio/F1_Strat_Manager

powered by

Devin

Radio Analysis View

Purpose and Scope

The Radio Analysis View provides capabilities for analyzing Formula 1 team radio communications to extract strategic insights. This component allows users to upload team radio audio files, transcribe them, analyze the content for sentiment and strategic significance, and integrate findings into the F1 Strategy Manager's recommendation system. For information about NLP models that power this functionality, see NLP Pipeline.

Component Architecture

The Radio Analysis View consists of two main components that work together to provide complete team radio analysis functionality:

  1. Radio Analysis Upload Component - Allows users to upload and process MP3 audio files
  2. Team Radio Analysis Component - Displays radio-based strategic recommendations

These components integrate with the broader NLP pipeline that processes team radio communications through multiple stages of analysis.

Radio Analysis System Architecture

Radio Upload Interface

The Radio Analysis Upload component allows users to upload MP3 files containing team radio communications. The component handles the complete processing pipeline from audio to structured data:

  1. File upload via Streamlit's file uploader
  2. Audio playback for user verification
  3. Transcription using Whisper-based speech recognition
  4. Analysis of transcribed text for sentiment, intent and entities
  5. Display of analysis results in JSON format

Implementation Workflow

Team Radio Analysis View

The Team Radio Analysis component displays strategic recommendations derived from radio communications. It filters the overall recommendation set to show only those based on radio analysis, such as:

  • Weather-related pit stop decisions (prepare_rain_tires)
  • Strategy adjustments (reevaluate_pit_window)
  • Pit stop prioritization (prioritize_pit)

Each recommendation includes:

  • The strategic action to take
  • The lap where the recommendation applies
  • A detailed explanation of the reasoning
  • A confidence score for the recommendation

Radio Recommendations Display

NLP Pipeline for Radio Analysis

The Radio Analysis component is powered by a sophisticated natural language processing pipeline that extracts valuable insights from team radio communications. This multi-stage pipeline processes audio files through:

  1. Audio Transcription - Using Whisper model to convert speech to text
  2. Sentiment Analysis - Using RoBERTa to classify the emotional tone
  3. Intent Classification - Identifying the purpose of the message
  4. Named Entity Recognition - Extracting key entities like drivers, components, and conditions

RoBERTa Sentiment Analysis Model

The sentiment analysis uses a fine-tuned RoBERTa model specifically adapted for Formula 1 team radio communications. The model:

  • Classifies messages as positive, neutral, or negative
  • Was trained on a dataset of 530 labeled F1 radio messages
  • Achieves 87.50% accuracy on test data
  • Handles F1-specific terminology and communication patterns

Sentiment Analysis Performance

The RoBERTa model for sentiment analysis delivers strong performance despite challenges of domain-specific language and class imbalance:

Sentiment Class Precision Recall F1-Score Support
Positive 66.67% 75.00% 70.59% 8
Neutral 91.38% 92.98% 92.17% 57
Negative 84.62% 73.33% 78.57% 15
Overall 87.65% 87.50% 87.46% 80

Integration with Strategy Recommendations

The Radio Analysis View integrates with the F1 Strategy Manager's recommendation system through:

  1. Creating RadioFact objects from analyzed team radio
  2. Feeding these facts into the F1RadioRules component of the expert system
  3. Generating strategy recommendations based on radio insights
  4. Displaying radio-specific recommendations in the Team Radio View

Radio-Based Strategy Generation

Technical Implementation Details

Audio Processing Workflow

The main workflow for audio processing is implemented in the render_radio_analysis_view() function, which:

  1. Creates a temporary directory for uploaded files
  2. Saves the uploaded MP3 file to this directory
  3. Calls transcribe_audio() to convert speech to text
  4. Passes the transcription to analyze_radio_message() for NLP analysis
  5. Displays the analysis results and cleans up temporary files

Key implementation details:

  • Uses Streamlit's file upload widget for the user interface
  • Handles errors during transcription and analysis
  • Manages temporary file cleanup to prevent storage bloat

Radio-Based Recommendations

The render_radio_analysis() function in team_radio_view.py processes strategy recommendations and filters them to display only those related to radio communications:

These recommendations are then displayed with detailed explanations to provide race strategy context derived from team radio communications.

Best Practices for Radio Analysis

For optimal results when using the Radio Analysis View:

  1. Audio Quality - Use clear audio recordings with minimal background noise
  2. Complete Messages - Upload complete radio messages for proper context analysis
  3. Multiple Sources - Analyze messages from both the team and driver for full context
  4. Time Context - Consider race conditions at the time of the radio message
  5. Strategic Verification - Use radio analysis as supporting information, not the sole decision factor

On this page