radio analysis view - VforVitorio/F1_Strat_Manager GitHub Wiki
Radio Analysis View
- Overview
- System Architecture
- Installation and Setup
- Streamlit Dashboard
- Strategy Recommendations View
- Gap Analysis View
- Radio Analysis View
- Time Predictions View
- Strategy Chat Interface
- Machine Learning Models
- Lap Time Prediction
- Tire Degradation Modeling
- Vision-based Gap Calculation
- NLP Pipeline
- Radio Transcription
- Sentiment and Intent Analysis
- Named Entity Recognition
- Expert System
- Degradation Rules
- Gap Analysis Rules
- Radio Message Rules
- Integrated Rule Engine
- Developer Guide
- API Reference
- Integration Guide
Radio Analysis View
- scripts/app/app_modules/nlp_radio_processing/N03_bert_sentiment.py
- scripts/app/components/gap_analysis_view.py
- scripts/app/components/overview_view.py
- scripts/app/components/radio_analysis_view.py
- scripts/app/components/team_radio_view.py
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:
- Radio Analysis Upload Component - Allows users to upload and process MP3 audio files
- 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:
- File upload via Streamlit's file uploader
- Audio playback for user verification
- Transcription using Whisper-based speech recognition
- Analysis of transcribed text for sentiment, intent and entities
- 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:
- Audio Transcription - Using Whisper model to convert speech to text
- Sentiment Analysis - Using RoBERTa to classify the emotional tone
- Intent Classification - Identifying the purpose of the message
- 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:
- Creating
RadioFact
objects from analyzed team radio - Feeding these facts into the
F1RadioRules
component of the expert system - Generating strategy recommendations based on radio insights
- 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:
- Creates a temporary directory for uploaded files
- Saves the uploaded MP3 file to this directory
- Calls
transcribe_audio()
to convert speech to text - Passes the transcription to
analyze_radio_message()
for NLP analysis - 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:
- Audio Quality - Use clear audio recordings with minimal background noise
- Complete Messages - Upload complete radio messages for proper context analysis
- Multiple Sources - Analyze messages from both the team and driver for full context
- Time Context - Consider race conditions at the time of the radio message
- Strategic Verification - Use radio analysis as supporting information, not the sole decision factor
On this page
- Radio Analysis View
- Purpose and Scope
- Component Architecture
- Radio Analysis System Architecture
- Radio Upload Interface
- Implementation Workflow
- Team Radio Analysis View
- Radio Recommendations Display
- NLP Pipeline for Radio Analysis
- RoBERTa Sentiment Analysis Model
- Sentiment Analysis Performance
- Integration with Strategy Recommendations
- Radio-Based Strategy Generation
- Technical Implementation Details
- Audio Processing Workflow
- Radio-Based Recommendations
- Best Practices for Radio Analysis