import marimo __generated_with = "0.11.26" app = marimo.App(width="full") @app.cell def _(): import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns import altair as alt return alt, np, pd, plt, sns @app.cell def _(platforms_data): # Complete the platform data with GC AI, Notebook LM, and Vecflow platforms_data.update( { 'GC AI': { 'metrics': [ {'metric': 'Pass Rate (Arthur)', 'value': 60}, {'metric': 'Pass Rate (Anna)', 'value': 40}, {'metric': 'Helpfulness (Arthur)', 'value': 1.4 * 50}, {'metric': 'Helpfulness (Anna)', 'value': 0.5 * 50}, {'metric': 'Adequate Length (Arthur)', 'value': 1.8 * 50}, {'metric': 'Adequate Length (Anna)', 'value': 1.0 * 50}, ], 'performance': [ {'task': 'Task #6', 'arthur': 6, 'anna': 0}, {'task': 'Task #13', 'arthur': 0, 'anna': 0}, {'task': 'Task #18', 'arthur': 6, 'anna': 6}, {'task': 'Task #19', 'arthur': 0, 'anna': 0}, {'task': 'Task #20', 'arthur': 6, 'anna': 0}, ], 'strengths': [ 'Good adequate length rating from Arthur', 'Decent pass rate from Arthur (60%)', 'Solid helpfulness score from Arthur', ], 'weaknesses': [ 'Lowest helpfulness rating from Anna (0.5/2.0)', 'Largest discrepancy between evaluators', 'Lower pass rate from Anna (40%)', ], }, 'Notebook LM': { 'metrics': [ {'metric': 'Pass Rate (Arthur)', 'value': 60}, {'metric': 'Pass Rate (Anna)', 'value': 60}, {'metric': 'Helpfulness (Arthur)', 'value': 0.8 * 50}, {'metric': 'Helpfulness (Anna)', 'value': 1.2 * 50}, {'metric': 'Adequate Length (Arthur)', 'value': 1.6 * 50}, {'metric': 'Adequate Length (Anna)', 'value': 2.0 * 50}, ], 'performance': [ {'task': 'Task #3', 'arthur': 6, 'anna': 0}, {'task': 'Task #6', 'arthur': 0, 'anna': 0}, {'task': 'Task #11', 'arthur': 0, 'anna': 6}, {'task': 'Task #13', 'arthur': 6, 'anna': 6}, {'task': 'Task #15', 'arthur': 6, 'anna': 6}, {'task': 'Task #19', 'arthur': 6, 'anna': 6}, ], 'strengths': [ 'Perfect agreement between Arthur and Anna on pass/fail', 'Highest adequate length rating from Anna (2.0/2.0)', 'Consistent pass rate between evaluators (60%)', ], 'weaknesses': [ 'Lower helpfulness rating from Arthur (0.8/2.0)', 'Mixed performance in specific tasks', ], }, 'Vecflow': { 'metrics': [ {'metric': 'Pass Rate (Arthur)', 'value': 60}, {'metric': 'Pass Rate (Anna)', 'value': 40}, {'metric': 'Helpfulness (Arthur)', 'value': 0.6 * 50}, {'metric': 'Helpfulness (Anna)', 'value': 0.6 * 50}, {'metric': 'Adequate Length (Arthur)', 'value': 1.8 * 50}, {'metric': 'Adequate Length (Anna)', 'value': 1.4 * 50}, ], 'performance': [ {'task': 'Task #11', 'arthur': 0, 'anna': 6}, {'task': 'Task #13', 'arthur': 6, 'anna': 0}, {'task': 'Task #15', 'arthur': 6, 'anna': 0}, {'task': 'Task #18', 'arthur': 6, 'anna': 6}, {'task': 'Task #19', 'arthur': 0, 'anna': 0}, ], 'strengths': [ 'Perfect agreement on helpfulness between evaluators', 'Strong adequate length scores from both evaluators', 'Good performance in specialized tasks', ], 'weaknesses': [ 'Lowest helpfulness rating overall (0.6/2.0)', 'Lower pass rate from Anna (40%)', 'Inconsistent evaluation on complex tasks', ], }, } ) return @app.cell def _(): # Platform data platforms_data = { 'Chat GPT': { 'metrics': [ {'metric': 'Pass Rate (Arthur)', 'value': 100}, {'metric': 'Pass Rate (Anna)', 'value': 40}, {'metric': 'Helpfulness (Arthur)', 'value': 1.5 * 50}, # Scaling to 0-100 {'metric': 'Helpfulness (Anna)', 'value': 1.25 * 50}, {'metric': 'Adequate Length (Arthur)', 'value': 1.75 * 50}, {'metric': 'Adequate Length (Anna)', 'value': 1.25 * 50}, ], 'performance': [{'task': 'Task #1', 'arthur': 6, 'anna': 0}, {'task': 'Task #3', 'arthur': 6, 'anna': 0}], 'strengths': [ 'High pass rate from Arthur (100%)', 'Strong helpfulness ratings from both evaluators', 'Good adequate length scores', ], 'weaknesses': ['Lower pass rate from Anna (40%)', 'Inconsistent evaluation between Arthur and Anna'], }, 'CoPilot': { 'metrics': [ {'metric': 'Pass Rate (Arthur)', 'value': 40}, {'metric': 'Pass Rate (Anna)', 'value': 60}, {'metric': 'Helpfulness (Arthur)', 'value': 1.0 * 50}, {'metric': 'Helpfulness (Anna)', 'value': 1.33 * 50}, {'metric': 'Adequate Length (Arthur)', 'value': 1.2 * 50}, {'metric': 'Adequate Length (Anna)', 'value': 1.33 * 50}, ], 'performance': [ {'task': 'Task #1', 'arthur': 6, 'anna': 6}, {'task': 'Task #11', 'arthur': 0, 'anna': 6}, {'task': 'Task #15', 'arthur': 0, 'anna': 0}, {'task': 'Task #18', 'arthur': 6, 'anna': 0}, {'task': 'Task #20', 'arthur': 0, 'anna': 6}, ], 'strengths': [ 'Balanced helpfulness scores from both evaluators', 'Consistent adequate length ratings', 'Higher pass rate from Anna than from Arthur', ], 'weaknesses': ['Lower overall pass rates', 'Inconsistent evaluation between tasks', 'Below-average scores on complex tasks'], }, 'DeepSeek': { 'metrics': [ {'metric': 'Pass Rate (Arthur)', 'value': 75}, {'metric': 'Pass Rate (Anna)', 'value': 100}, {'metric': 'Helpfulness (Arthur)', 'value': 1.33 * 50}, {'metric': 'Helpfulness (Anna)', 'value': 2.0 * 50}, {'metric': 'Adequate Length (Arthur)', 'value': 2.0 * 50}, {'metric': 'Adequate Length (Anna)', 'value': 1.67 * 50}, ], 'performance': [ {'task': 'Task #11', 'arthur': 6, 'anna': 6}, {'task': 'Task #13', 'arthur': 6, 'anna': 0}, {'task': 'Task #18', 'arthur': 6, 'anna': 6}, {'task': 'Task #19', 'arthur': 0, 'anna': 6}, ], 'strengths': [ 'Perfect pass rate from Anna (100%)', 'Highest helpfulness rating from Anna (2.0/2.0)', 'Highest adequate length rating from Arthur (2.0/2.0)', 'Strong overall performance across metrics', ], 'weaknesses': ['Some inconsistency between evaluators', 'Lower pass rate from Arthur compared to Anna'], }, } return (platforms_data,) @app.cell def _(platforms_data): # Complete the platform data with GC AI, Notebook LM, and Vecflow platforms_data.update( { 'GC AI': { 'metrics': [ {'metric': 'Pass Rate (Arthur)', 'value': 60}, {'metric': 'Pass Rate (Anna)', 'value': 40}, {'metric': 'Helpfulness (Arthur)', 'value': 1.4 * 50}, {'metric': 'Helpfulness (Anna)', 'value': 0.5 * 50}, {'metric': 'Adequate Length (Arthur)', 'value': 1.8 * 50}, {'metric': 'Adequate Length (Anna)', 'value': 1.0 * 50}, ], 'performance': [ {'task': 'Task #6', 'arthur': 6, 'anna': 0}, {'task': 'Task #13', 'arthur': 0, 'anna': 0}, {'task': 'Task #18', 'arthur': 6, 'anna': 6}, {'task': 'Task #19', 'arthur': 0, 'anna': 0}, {'task': 'Task #20', 'arthur': 6, 'anna': 0}, ], 'strengths': [ 'Good adequate length rating from Arthur', 'Decent pass rate from Arthur (60%)', 'Solid helpfulness score from Arthur', ], 'weaknesses': [ 'Lowest helpfulness rating from Anna (0.5/2.0)', 'Largest discrepancy between evaluators', 'Lower pass rate from Anna (40%)', ], }, 'Notebook LM': { 'metrics': [ {'metric': 'Pass Rate (Arthur)', 'value': 60}, {'metric': 'Pass Rate (Anna)', 'value': 60}, {'metric': 'Helpfulness (Arthur)', 'value': 0.8 * 50}, {'metric': 'Helpfulness (Anna)', 'value': 1.2 * 50}, {'metric': 'Adequate Length (Arthur)', 'value': 1.6 * 50}, {'metric': 'Adequate Length (Anna)', 'value': 2.0 * 50}, ], 'performance': [ {'task': 'Task #3', 'arthur': 6, 'anna': 0}, {'task': 'Task #6', 'arthur': 0, 'anna': 0}, {'task': 'Task #11', 'arthur': 0, 'anna': 6}, {'task': 'Task #13', 'arthur': 6, 'anna': 6}, {'task': 'Task #15', 'arthur': 6, 'anna': 6}, {'task': 'Task #19', 'arthur': 6, 'anna': 6}, ], 'strengths': [ 'Perfect agreement between Arthur and Anna on pass/fail', 'Highest adequate length rating from Anna (2.0/2.0)', 'Consistent pass rate between evaluators (60%)', ], 'weaknesses': [ 'Lower helpfulness rating from Arthur (0.8/2.0)', 'Mixed performance in specific tasks', ], }, 'Vecflow': { 'metrics': [ {'metric': 'Pass Rate (Arthur)', 'value': 60}, {'metric': 'Pass Rate (Anna)', 'value': 40}, {'metric': 'Helpfulness (Arthur)', 'value': 0.6 * 50}, {'metric': 'Helpfulness (Anna)', 'value': 0.6 * 50}, {'metric': 'Adequate Length (Arthur)', 'value': 1.8 * 50}, {'metric': 'Adequate Length (Anna)', 'value': 1.4 * 50}, ], 'performance': [ {'task': 'Task #11', 'arthur': 0, 'anna': 6}, {'task': 'Task #13', 'arthur': 6, 'anna': 0}, {'task': 'Task #15', 'arthur': 6, 'anna': 0}, {'task': 'Task #18', 'arthur': 6, 'anna': 6}, {'task': 'Task #19', 'arthur': 0, 'anna': 0}, ], 'strengths': [ 'Perfect agreement on helpfulness between evaluators', 'Strong adequate length scores from both evaluators', 'Good performance in specialized tasks', ], 'weaknesses': [ 'Lowest helpfulness rating overall (0.6/2.0)', 'Lower pass rate from Anna (40%)', 'Inconsistent evaluation on complex tasks', ], }, } ) return @app.cell def _(pd): # Task type data task_type_data = pd.DataFrame( [ {'name': 'Simple Extraction', 'arthur': 80, 'anna': 70}, {'name': 'Complex Analysis', 'arthur': 65, 'anna': 60}, {'name': 'Regulatory/Legal', 'arthur': 50, 'anna': 40}, {'name': 'Identification', 'arthur': 90, 'anna': 75}, {'name': 'Summarization', 'arthur': 70, 'anna': 65}, ] ) # Platform performance over time data trend_data = { 'Chat GPT': [ {'task': 1, 'arthur': 6, 'anna': 0}, {'task': 3, 'arthur': 6, 'anna': 0}, {'task': 11, 'arthur': 6, 'anna': 0}, {'task': 13, 'arthur': 6, 'anna': 6}, {'task': 18, 'arthur': 6, 'anna': 6}, ], 'CoPilot': [ {'task': 1, 'arthur': 6, 'anna': 6}, {'task': 11, 'arthur': 0, 'anna': 6}, {'task': 15, 'arthur': 0, 'anna': 0}, {'task': 18, 'arthur': 6, 'anna': 0}, {'task': 20, 'arthur': 0, 'anna': 6}, ], 'DeepSeek': [ {'task': 11, 'arthur': 6, 'anna': 6}, {'task': 13, 'arthur': 6, 'anna': 0}, {'task': 18, 'arthur': 6, 'anna': 6}, {'task': 19, 'arthur': 0, 'anna': 6}, ], 'GC AI': [ {'task': 6, 'arthur': 6, 'anna': 0}, {'task': 13, 'arthur': 0, 'anna': 0}, {'task': 18, 'arthur': 6, 'anna': 6}, {'task': 19, 'arthur': 0, 'anna': 0}, {'task': 20, 'arthur': 6, 'anna': 0}, ], 'Notebook LM': [ {'task': 3, 'arthur': 6, 'anna': 0}, {'task': 6, 'arthur': 0, 'anna': 0}, {'task': 11, 'arthur': 0, 'anna': 6}, {'task': 13, 'arthur': 6, 'anna': 6}, {'task': 15, 'arthur': 6, 'anna': 6}, {'task': 19, 'arthur': 6, 'anna': 6}, ], 'Vecflow': [ {'task': 11, 'arthur': 0, 'anna': 6}, {'task': 13, 'arthur': 6, 'anna': 0}, {'task': 15, 'arthur': 6, 'anna': 0}, {'task': 18, 'arthur': 6, 'anna': 6}, {'task': 19, 'arthur': 0, 'anna': 0}, ], } # Map pass/fail values to binary for plotting mapped_trend_data = {} for platform, data in trend_data.items(): mapped_trend_data[platform] = [ {'task': item['task'], 'arthur': 1 if item['arthur'] == 6 else 0, 'anna': 1 if item['anna'] == 6 else 0} for item in data ] return data, mapped_trend_data, platform, task_type_data, trend_data @app.cell def _(alt, mapped_trend_data, pd): def plot_task_performance_interactive(platform_name): """Create an interactive line chart for task performance""" # Convert to DataFrame data = pd.DataFrame(mapped_trend_data[platform_name]) # Melt the dataframe for Altair data_melted = data.melt(id_vars=['task'], var_name='evaluator', value_name='result') # Create a color scale color_scale = alt.Scale(domain=['arthur', 'anna'], range=['#4c78a8', '#ff7f0e']) # Create the chart chart = ( alt.Chart(data_melted) .mark_line(point=True) .encode( x=alt.X('task:N', title='Task Number'), y=alt.Y( 'result:N', title='Result', scale=alt.Scale(domain=[0, 1]), axis=alt.Axis(labelExpr="datum.value === 0 ? 'Fail' : 'Pass'") ), color=alt.Color('evaluator:N', title='Evaluator', scale=color_scale, legend=alt.Legend(title='Evaluator')), tooltip=['task', 'evaluator', alt.Tooltip('result', title='Result', format='.0f', formatType='number')], ) .transform_calculate(result_label="datum.result === 0 ? 'Fail' : 'Pass'") .properties(width=500, height=300, title=f'{platform_name} Task Performance') .configure_title(fontSize=20, anchor='start') .configure_axis(labelFontSize=12, titleFontSize=14) .configure_point(size=100) .interactive() ) return chart return (plot_task_performance_interactive,) @app.cell def _(alt, task_type_data): def plot_task_type_performance_interactive(): """Create an interactive bar chart for task type performance""" # Melt the dataframe for Altair task_type_melted = task_type_data.melt(id_vars=['name'], var_name='evaluator', value_name='score') # Create a color scale color_scale = alt.Scale(domain=['arthur', 'anna'], range=['#4c78a8', '#ff7f0e']) # Create the chart chart = ( alt.Chart(task_type_melted) .mark_bar() .encode( x=alt.X('name:N', title='Task Type', axis=alt.Axis(labelAngle=-45)), y=alt.Y('score:Q', title='Average Score (%)'), color=alt.Color('evaluator:N', title='Evaluator', scale=color_scale), tooltip=['name', 'evaluator', alt.Tooltip('score', title='Score', format='.0f')], ) .properties(width=600, height=400, title='Task Type Performance Analysis') .configure_title(fontSize=20, anchor='start') .configure_axis(labelFontSize=12, titleFontSize=14) .interactive() ) return chart return (plot_task_type_performance_interactive,) @app.cell def _( display_platform_evaluation, platform_summary, plot_platform_radar_interactive, plot_task_performance_interactive, ): def analyze_platform_interactive(platform_name='DeepSeek'): """Create a comprehensive interactive analysis for a single platform""" from IPython.display import display, HTML, Markdown # Display the platform name display(Markdown(f'# AI Platform In-Depth Analysis: {platform_name}')) # Create the radar chart for metrics display(Markdown('## Performance Metrics')) display(plot_platform_radar_interactive(platform_name)) # Show task performance display(Markdown('## Task Performance')) display(plot_task_performance_interactive(platform_name)) # Display strengths and weaknesses display(Markdown('## Platform Evaluation')) display_platform_evaluation(platform_name) # Show platform summary display(Markdown('## Platform Summary')) platform_summary(platform_name) return None return (analyze_platform_interactive,) @app.cell def _(analyze_platform_interactive): # Analyze Vecflow analyze_platform_interactive('Vecflow') return @app.cell def _(analyze_platform_interactive): # Analyze Vecflow analyze_platform_interactive('Vecflow') return @app.cell def _(analyze_platform_interactive): # Analyze Notebook LM analyze_platform_interactive('Notebook LM') return @app.cell def _(analyze_platform_interactive): # Analyze GC AI analyze_platform_interactive('GC AI') return @app.cell def _(analyze_platform_interactive): # Analyze CoPilot analyze_platform_interactive('CoPilot') return @app.cell def _(analyze_platform_interactive): # Analyze Chat GPT analyze_platform_interactive('Chat GPT') return @app.cell def _(analyze_platform_interactive): # Analyze DeepSeek analyze_platform_interactive('DeepSeek') return @app.cell def _(compare_all_platforms_interactive): # Compare all platforms compare_all_platforms_interactive() return @app.cell def _( compare_platforms_interactive, pd, platforms_data, plot_task_type_performance_interactive, ): def compare_all_platforms_interactive(): """Display interactive comparison of all platforms""" from IPython.display import display, Markdown # Display the title display(Markdown('# AI Platform Comparison')) # Show interactive comparison chart display(Markdown('## Metrics Comparison')) display(compare_platforms_interactive()) # Show task type performance display(Markdown('## Task Type Performance')) display(plot_task_type_performance_interactive()) # Overall rankings display(Markdown('## Overall Platform Rankings')) # Calculate average metrics for each platform rankings = [] for platform, data in platforms_data.items(): avg_metrics = sum(metric['value'] for metric in data['metrics']) / len(data['metrics']) rankings.append({'Platform': platform, 'Average Score': avg_metrics}) rankings_df = pd.DataFrame(rankings) rankings_df.sort_values('Average Score', ascending=False, inplace=True) # Create a DataFrame to display rankings for i, (idx, row) in enumerate(rankings_df.iterrows(), 1): print(f'{i}. {row["Platform"]} - Average Score: {row["Average Score"]:.2f}') return None return (compare_all_platforms_interactive,) @app.cell def _(alt, pd, platforms_data): def compare_platforms_interactive(): """Create an interactive chart for comparing all platforms""" # Create a DataFrame with all platform metrics metrics_comparison = [] for platform, data in platforms_data.items(): for metric in data['metrics']: metrics_comparison.append({'Platform': platform, 'Metric': metric['metric'], 'Value': metric['value']}) comparison_df = pd.DataFrame(metrics_comparison) # Create a grouped bar chart chart = ( alt.Chart(comparison_df) .mark_bar() .encode( x=alt.X('Platform:N', title='Platform'), y=alt.Y('Value:Q', title='Score'), color=alt.Color('Platform:N', legend=None), column=alt.Column('Metric:N', title=None), tooltip=['Platform', 'Metric', 'Value'], ) .properties(width=100, title='Platform Metric Comparison') .configure_title(fontSize=20, anchor='start') .configure_axis(labelFontSize=12, titleFontSize=14) .interactive() ) return chart return (compare_platforms_interactive,) @app.cell def _(alt, pd, platforms_data): def plot_platform_radar_interactive(platform_name): """Create an interactive radar chart for platform metrics using Altair""" # Get platform metrics data metrics = platforms_data[platform_name]['metrics'] # Convert to long format for Altair metrics_df = pd.DataFrame(metrics) # Create the base chart chart = ( alt.Chart(metrics_df) .mark_line(point=True) .encode( x=alt.X('metric:N', title=None, sort=None), y=alt.Y('value:Q', scale=alt.Scale(domain=[0, 100]), title='Score'), color=alt.value('#4c78a8'), tooltip=['metric', 'value'], ) .properties(width=500, height=400, title=f'{platform_name} Performance Metrics') .configure_title(fontSize=20, anchor='start') .configure_axis(labelFontSize=12, titleFontSize=14) .configure_point(size=100) .interactive() ) return chart return (plot_platform_radar_interactive,) @app.cell def _(alt): alt.renderers.enable('default') return @app.cell def _(compare_all_platforms): # Compare all platforms compare_all_platforms() return @app.cell def _(pd, platforms_data, plot_task_type_performance, plt): def compare_all_platforms(): """Display comparison of all platforms""" # Create a DataFrame with all platform metrics for comparison metrics_comparison = [] for platform, data in platforms_data.items(): # Extract metrics platform_metrics = {metric['metric']: metric['value'] for metric in data['metrics']} platform_metrics['Platform'] = platform metrics_comparison.append(platform_metrics) comparison_df = pd.DataFrame(metrics_comparison) comparison_df.set_index('Platform', inplace=True) # Display the comparison table print('# AI Platform Comparison\n') print('## Metrics Comparison') print(comparison_df) # Create a bar chart to compare platforms plt.figure(figsize=(14, 8)) comparison_df.plot(kind='bar', figsize=(14, 8)) plt.title('Platform Metrics Comparison') plt.xlabel('Platform') plt.ylabel('Score') plt.legend(title='Metrics', bbox_to_anchor=(1.05, 1), loc='upper left') plt.tight_layout() print('\n## Task Type Performance') plot_task_type_performance() # Overall rankings print('\n## Overall Platform Rankings') # Calculate average metrics for each platform rankings = [] for platform, data in platforms_data.items(): avg_metrics = sum(metric['value'] for metric in data['metrics']) / len(data['metrics']) rankings.append({'Platform': platform, 'Average Score': avg_metrics}) rankings_df = pd.DataFrame(rankings) rankings_df.sort_values('Average Score', ascending=False, inplace=True) # Display rankings for i, (idx, row) in enumerate(rankings_df.iterrows(), 1): print(f'{i}. {row["Platform"]} - Average Score: {row["Average Score"]:.2f}') return plt.gca() return (compare_all_platforms,) @app.cell def _(compare_all_platforms): # Compare all platforms compare_all_platforms() return @app.cell def _(platforms_data): def platform_summary(platform_name): """Display a summary of the platform performance""" summaries = { 'DeepSeek': 'DeepSeek shows the strongest overall performance across both evaluators, with a perfect pass rate from Anna and high marks on both helpfulness and adequate length metrics. It consistently delivers high-quality responses across various task types.', 'Chat GPT': "Chat GPT performs excellently according to Arthur with a perfect pass rate, but shows inconsistency with Anna's evaluations. Its strengths lie in helpfulness and adequate response length, particularly in extraction and summarization tasks.", 'Notebook LM': 'Notebook LM demonstrates the highest level of evaluator agreement with identical pass rates from Arthur and Anna. It excels in adequate length ratings but scores lower on helpfulness metrics from Arthur.', 'CoPilot': 'CoPilot shows moderate performance across metrics with slightly higher ratings from Anna than Arthur. It maintains consistency in adequate length but struggles with more complex analysis tasks.', 'GC AI': 'GC AI exhibits the largest discrepancy between evaluator ratings, with Arthur giving significantly higher scores than Anna across all metrics. It performs well in adequate length according to Arthur but scores poorly in helpfulness from Anna.', 'Vecflow': 'Vecflow demonstrates perfect agreement on helpfulness ratings between evaluators, though these scores are the lowest across all platforms. It excels in adequate length metrics but shows inconsistent pass rates between evaluators.', } # Create tags for the platform tags = [] metrics = platforms_data[platform_name]['metrics'] tags.append(f'📊 {platform_name}') if metrics[0]['value'] >= 60: tags.append('🟢 High Arthur Pass Rate') if metrics[1]['value'] >= 60: tags.append('🟢 High Anna Pass Rate') if metrics[2]['value'] / 50 >= 1.3: tags.append('🟣 Strong Helpfulness (Arthur)') if metrics[3]['value'] / 50 >= 1.3: tags.append('🟣 Strong Helpfulness (Anna)') if metrics[4]['value'] / 50 >= 1.7: tags.append('🔵 Excellent Length (Arthur)') if metrics[5]['value'] / 50 >= 1.7: tags.append('🔵 Excellent Length (Anna)') if metrics[0]['value'] == metrics[1]['value']: tags.append('🟡 Evaluator Agreement') print(f'== {platform_name} Summary ==\n') print(summaries[platform_name]) print('\nTags:') print(' '.join(tags)) return None return (platform_summary,) @app.cell def _(np, platforms_data, plt): def plot_platform_radar(platform_name): """Create a radar chart for platform metrics with enhanced styling""" metrics = platforms_data[platform_name]['metrics'] # Extract data categories = [m['metric'] for m in metrics] values = [m['value'] for m in metrics] # Number of categories N = len(categories) # Create angle for each category angles = [n / float(N) * 2 * np.pi for n in range(N)] angles += angles[:1] # Close the loop # Add the first value at the end to close the circle values += values[:1] # Create figure fig, ax = plt.subplots(figsize=(10, 6), subplot_kw=dict(polar=True), facecolor='#f8f9fa') # Draw the chart ax.plot(angles, values, linewidth=2, linestyle='solid', label=platform_name, color='#8884d8') ax.fill(angles, values, alpha=0.25, color='#8884d8') # Set category labels plt.xticks(angles[:-1], categories, size=10, fontweight='bold', color='#444444') # Set y-axis limits ax.set_ylim(0, 100) # Add grid ax.grid(color='#dddddd', linestyle='-', linewidth=0.5) # Set background color for each level ax.set_facecolor('#f8f9fa') # Add title with platform-specific color platform_colors = { 'DeepSeek': '#6b5b95', 'Chat GPT': '#3498db', 'CoPilot': '#f39c12', 'GC AI': '#1abc9c', 'Notebook LM': '#e74c3c', 'Vecflow': '#9b59b6', } color = platform_colors.get(platform_name, '#8884d8') plt.title(f'{platform_name} Performance Metrics', size=16, fontweight='bold', color=color, pad=20) # Add legend plt.legend(loc='upper right', bbox_to_anchor=(0.1, 0.1), frameon=True, facecolor='white', edgecolor='#dddddd') plt.tight_layout() return plt.gca() return (plot_platform_radar,) @app.cell def _(mapped_trend_data, pd, plt, sns): def plot_task_performance(platform_name): """Create an enhanced line chart for task performance""" # Convert to DataFrame data = pd.DataFrame(mapped_trend_data[platform_name]) # Set a theme sns.set_style('whitegrid') plt.figure(figsize=(10, 6), facecolor='#f8f9fa') # Platform-specific colors platform_colors = { 'DeepSeek': ('#6b5b95', '#d64161'), 'Chat GPT': ('#3498db', '#1abc9c'), 'CoPilot': ('#f39c12', '#e67e22'), 'GC AI': ('#1abc9c', '#16a085'), 'Notebook LM': ('#e74c3c', '#c0392b'), 'Vecflow': ('#9b59b6', '#8e44ad'), } arthur_color, anna_color = platform_colors.get(platform_name, ('#8884d8', '#82ca9d')) # Plot lines with enhanced styling plt.plot( data['task'], data['arthur'], marker='o', markersize=10, linestyle='-', linewidth=2.5, label="Arthur's Evaluation", color=arthur_color, alpha=0.9, ) plt.plot( data['task'], data['anna'], marker='s', markersize=10, linestyle='-', linewidth=2.5, label="Anna's Evaluation", color=anna_color, alpha=0.9, ) # Customize plot plt.title(f'{platform_name} Task Performance', fontsize=16, fontweight='bold') plt.xlabel('Task Number', fontsize=12, fontweight='bold') plt.ylabel('Result', fontsize=12, fontweight='bold') # Set y-axis to show Pass/Fail instead of 1/0 plt.yticks([0, 1], ['Fail', 'Pass'], fontsize=12) # Ensure x-axis shows integer task numbers plt.xticks(data['task'], fontsize=11) plt.grid(True, linestyle='--', alpha=0.7) # Enhanced legend legend = plt.legend( loc='upper center', bbox_to_anchor=(0.5, -0.15), facecolor='white', edgecolor='#dddddd', shadow=True, ncol=2, fontsize=12 ) # Add a border to the plot ax = plt.gca() for spine in ax.spines.values(): spine.set_edgecolor('#dddddd') spine.set_linewidth(1.5) plt.tight_layout() return plt.gca() return (plot_task_performance,) @app.cell def _(platforms_data): def display_platform_evaluation(platform_name): """Display platform strengths and weaknesses with HTML styling""" strengths = platforms_data[platform_name]['strengths'] weaknesses = platforms_data[platform_name]['weaknesses'] # Platform-specific color platform_colors = { 'DeepSeek': '#6b5b95', 'Chat GPT': '#3498db', 'CoPilot': '#f39c12', 'GC AI': '#1abc9c', 'Notebook LM': '#e74c3c', 'Vecflow': '#9b59b6', } color = platform_colors.get(platform_name, '#8884d8') html_output = f"""
Analyzing differences between Arthur's and Anna's evaluations
Analyzing differences between Arthur's and Anna's evaluations